Below code (Snippet 1) fails to compile in JDK 7.0_7 compiler (Error: reference to go is ambiguous, both method go(int...) in A and method go(java.lang.Integer...) in A match)
Snippet 1
Meanwhile this code (Snippet 2) compiles fine with JDK 7.0_7 and displays " primitive" on running. But the code doesn't compile on my other compiler Eclipse Compiler 0.A48 ( Error: The method go(int[]) is ambiguous for the type A. )
Snippet 2
So "snippet 2" seems to be an old compiler bug fixed in
Java 7. What about "Snippet 1" ? Is this an unfixed bug with Java 7 compiler ? On the other hand , Is this compiler error a correct behaviour ? Can somebody kindly explain from the JLS .