Bug 75400 - [1.5] Wrong type mismatch error reported
Summary: [1.5] Wrong type mismatch error reported
Status: VERIFIED FIXED
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 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-30 13:59 EDT by Olivier Thomann CLA
Modified: 2004-11-04 10:09 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 Olivier Thomann CLA 2004-09-30 13:59:29 EDT
Using the latest code, the following code reports an error and it should not:

public class X<T> implements I<T> {
    public I.A foo() {
        return a;
    }
}    
interface I<T> {
    A a = new A();
    class A {
    }
}

We report:
----------
1. ERROR in c:\tests_sources\X.java (at line 3)
	return a;
	       ^
Type mismatch: cannot convert from I<T>.A to I.A
----------
1 problem (1 error)

javac 1.5 compiles it without error.
Comment 1 Philipe Mulet CLA 2004-10-28 16:09:52 EDT
Implementation of type equivalence was incorrectly rejecting this scenario (due
to  check on no type variables improper for member types).

Added regression test: GenericTypeTest#test326.
Fixed
Comment 2 David Audel CLA 2004-11-04 10:09:17 EST
Verified for 3.1M3 with build I200411040100