Community
Participate
Working Groups
Related to bug 90423, if the code is changed to: public class Overloading { public static <S extends String> S foo() { System.out.println("String"); return null; } public static <N extends Number> N foo() { System.out.println("Number"); return null; } public static void main(String[] args) { Overloading.<String>foo(); Overloading.<Number>foo(); Overloading o = new Overloading(); foo(); } } it compiles fine, but javac reports: Overloading.java:17: reference to foo is ambiguous, both method <S>foo() in Overloading and method <N>foo() in Overloading match foo(); ^ 1 error
Added onto MethodVerify test050
Verified using N20050606-0010 + JDT/Core HEAD
Verified for 3.1 RC2 using build I20050610-0010
close