Community
Participate
Working Groups
This code: if (!lastArgType.isCompatibleWith(varargsType.elementsType())) return; return; looks suspicious. Removing the second return; breaks some existing tests in org.eclipse.jdt.core.tests.compiler.regression.VarargsTest. See test029, 038, 043, 028 and 045.
Note that the released code is missing unnecessary cast diagnostic for: public class X { void foo(Throwable... exceptions) { } void bar(Exception[] exceptions) { foo((Throwable[])exceptions); // unnecessary cast } } fix is to write instead: (note need to reverse condition) if (lastArgType.isCompatibleWith(varargsType.elementsType())) return;
Added VarargsTest#test046. Fixed
Verified for 3.2 RC1 using build I20060413-0010.