Bug 165645 - [1.5][compiler] Member type should take precedence over enclosing type parameters
Summary: [1.5][compiler] Member type should take precedence over enclosing type parame...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-23 05:37 EST by Philipe Mulet CLA
Modified: 2006-12-11 16:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2006-11-23 05:37:25 EST
Build 3.3M3

The following program should be rejected on line "b.foo()".
It currently is rejected instead the line "b.bar()".

Problem comes from the fact type parameters are taking precedence over member types, which they shouldn't.

interface IFoo { void foo(); }
interface IBar { void bar(); }
public class X<Bar extends IFoo> {
	class Bar implements IBar { public void bar(){} }
	void foo(Bar b) {
		b.foo(); // unbound (Bar is member type)
		b.bar(); // ok
	}
}
Comment 1 Philipe Mulet CLA 2006-11-23 05:38:38 EST
Javac has same bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5060485
Comment 2 Philipe Mulet CLA 2006-11-23 09:00:00 EST
Added GenericTypeTest#test1086
Comment 3 Philipe Mulet CLA 2006-11-23 11:34:13 EST
Added GenericTypeTest#test1087-1089.
Comment 4 Philipe Mulet CLA 2006-11-23 12:37:04 EST
Fix consists in swapping Scope#getTypeOrPackage section for classscope lookup for type param and member type.

Released for 3.3M4
Comment 5 Olivier Thomann CLA 2006-12-11 16:16:57 EST
Verified for 3.3M4 with I20061211-1119