Bug 94754 - [1.5][compiler] Ambiguous method call is not detected
Summary: [1.5][compiler] Ambiguous method call is not detected
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-11 11:30 EDT by Olivier Thomann CLA
Modified: 2005-06-10 10:24 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2005-05-11 11:30:52 EDT
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
Comment 1 Kent Johnson CLA 2005-06-03 11:04:09 EDT
Added onto MethodVerify test050
Comment 2 Olivier Thomann CLA 2005-06-06 16:54:17 EDT
Verified using N20050606-0010 + JDT/Core HEAD
Comment 3 Maxime Daniel CLA 2005-06-10 07:17:36 EDT
Verified for 3.1 RC2 using build I20050610-0010
Comment 4 Frederic Fusier CLA 2005-06-10 10:24:21 EDT
close