Bug 170765

Summary: [1.5][compiler] passing a sub class array as vararg parameter should not be flagged as 'inexact type match'
Product: [Eclipse Project] JDT Reporter: Christopher Sahnwaldt <jcsahnwaldt>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jcsahnwaldt
Version: 3.2.1   
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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