Bug 170765 - [1.5][compiler] passing a sub class array as vararg parameter should not be flagged as 'inexact type match'
Summary: [1.5][compiler] passing a sub class array as vararg parameter should not be f...
Status: RESOLVED DUPLICATE of bug 159607
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 09:04 EST by Christopher Sahnwaldt CLA
Modified: 2007-01-22 04:12 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Sahnwaldt CLA 2007-01-17 09:04:56 EST
Build ID: M20060921-0945

Steps To Reproduce:
1. In the compiler error preferences, set "Inexact type match for vararg arguments" to "Error".

2. Compile the following class:

public class Foo
{
  public void foo()
  {
    Integer[] array = null;
    varargs(array);
  }

  public void varargs( Number ... o )
  {
  }
}


3. The line "varargs(array);" is marked as an error. The description reads "The argument of type Integer[] should explicitly be cast to Number[] for the invocation of the varargs method varargs(Number ...) from type Foo. It could alternatively be cast to Number for a varargs invocation".

More information:
Comment 1 Philipe Mulet CLA 2007-01-22 04:08:19 EST
Fixed in 3.3 stream

*** This bug has been marked as a duplicate of bug 159607 ***
Comment 2 Philipe Mulet CLA 2007-01-22 04:12:43 EST
Added regression test: VarargsTest#test059