Bug 75134 - [1.5] Type mismatch error generated
Summary: [1.5] Type mismatch error generated
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 75525 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-27 18:31 EDT by Bart Geraci CLA
Modified: 2004-11-04 07:23 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 Bart Geraci CLA 2004-09-27 18:31:00 EDT
Given the code on 3.1M2, using Java 1.5.0-rc:
********
import java.util.*;
public class Test2<A> {

  A v2;
  Test2(A a) { v2 = a; }
  
  void func() {
    List<B<A>> l = new ArrayList<B<A>>();
  }

  class B<T> {
    T v1;
    B(T b) {  v1 = b; }
  }
  
}
************
There are 4 cases
(1) class B is defined within class Test2 as above, I get the error
   "Type mismatch: cannot convert from ArrayList<Test2.B<A>> to 
      List<Test2.B<A>>"
(2) class B is defined within class Test2 as above, but now "static", 
    I get the same error.
(3) same as case (2), but the parameter type to List and ArrayList are 
    fully qualified like so: "List<Test2.B<A>>", the I do not get the error.
(4) class B is defined (non-static) outside the Test2 class definition, but
  still within the same file, then I do not get the error.
Comment 1 Kent Johnson CLA 2004-09-29 11:24:58 EDT
Another member type compatibility case
Comment 2 Philipe Mulet CLA 2004-10-25 09:42:00 EDT
First member type (from single/qualified scenario) was not recreating raw
enclosing type when accessed implicitly.

Fixed. Added regression test: GenericTypeTest#test322
Comment 3 Frederic Fusier CLA 2004-10-27 12:13:35 EDT
*** Bug 75525 has been marked as a duplicate of this bug. ***
Comment 4 David Audel CLA 2004-11-04 07:23:30 EST
Verified for 3.1M3 with build I200411040100