Bug 107756 - [1.5][compiler] Invalid diagnostic invoking method through raw interface
Summary: [1.5][compiler] Invalid diagnostic invoking method through raw interface
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-23 13:35 EDT by Tim Hanson CLA
Modified: 2005-09-26 12:05 EDT (History)
0 users

See Also:


Attachments
Proposed patch (1015 bytes, patch)
2005-08-31 17:10 EDT, Tim Hanson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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