Bug 82955 - [1.5] problem with type inference
Summary: [1.5] problem with type inference
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-17 05:33 EST by Martin Aeschlimann CLA
Modified: 2005-02-15 12:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2005-01-17 05:33:13 EST
20050117

The following code is accepted by Javac but not by the jdt.core compiler.
(code taken from example code from reviewing the Eclipse chapter of 'Learning
Java, 3rd Edition')

public class TypeInference 
{
	static <T extends Base> T infer( T t1, T t2 ) { return null; }

	public static void main( String [] args )
	{
		Base base = infer( new Sub1(), new Sub2() );
		// Note: Eclipse 3.1 says this is an error, but it's not
		Runnable runnable = infer( new Sub1(), new Sub2() );
	}

}

class Base { }
class Sub1 extends Base implements Runnable { public void run() { } }
class Sub2 extends Base implements Runnable { public void run() { } }
Comment 1 Frederic Fusier CLA 2005-02-15 12:21:17 EST
Surely fixed with latest 1.5 changes