Bug 107756

Summary: [1.5][compiler] Invalid diagnostic invoking method through raw interface
Product: [Eclipse Project] JDT Reporter: Tim Hanson <thanson>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Tim Hanson CLA 2005-08-23 13:35:21 EDT
The compiler is issuing an invalid diagnostic saying "cannot convert from
Unmarshaller.Handler to Unmarshaller.Handler" when assigning to h.


interface Prop<BeanT> {
	Unmarshaller.Handler createHandler();
}

abstract class Unmarshaller {
	public static abstract class Handler {}
}

class X {
	void foo(Prop p) {
		Unmarshaller.Handler h = p.createHandler(); 
	}
}
Comment 1 Olivier Thomann CLA 2005-08-23 13:46:13 EDT
Reproduced in latest.
Comment 2 Tim Hanson CLA 2005-08-31 17:10:08 EDT
Created attachment 26740 [details]
Proposed patch

The problem is that scope is creating a raw type for handler because it is a
nested type. The patch modifies the substitution code to only create the raw
type for a nested type if the outer type is susbstituted.
Comment 3 Philipe Mulet CLA 2005-09-02 07:09:49 EDT
Thanks Tim, you identified well the offending code in Scope. My fix is very
similar, simply reorganized the code to deal with member types in the previous
catch (no more fall-thru which ends up adding complexity).

Added GenericTypeTest#test0807-808.
Fixed
Comment 4 David Audel CLA 2005-09-21 10:41:47 EDT
Verified in I20050921-0010 for 3.2M2
Comment 5 David Audel CLA 2005-09-26 12:05:29 EDT
Verified using M20050923-1430 for 3.1.1