Bug 77051 - [1.5] Type mismatch involving super
Summary: [1.5] Type mismatch involving super
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:
Depends on:
Blocks:
 
Reported: 2004-10-26 15:49 EDT by Bart Geraci CLA
Modified: 2004-11-04 09:46 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 Bart Geraci CLA 2004-10-26 15:49:28 EDT
Running Build 200410260800 & Java 1.5 : 

This code below compiles without problem using javac, but Eclipse reports error
as seen in comment. The other two versions are fine.

==============
interface C<A> { }
interface PC<X> extends C<X> { } 

interface PO<Y>  {  
  C<Y> proc1();
  C<? super Y> proc2();
  C<? extends Y> proc3();
}

abstract class SPO<Z> implements PO<Z> {
  public C<Z> proc1() { return result1; }
  private final PC<Z> result1 = null;
  
  public C<? super Z> proc2() { return result2; }
  // The above line is reported as error in Eclipse:
  // result2 is underlined and the message says
  // Type mismatch: cannot convert from PC<? super Z> to C<? super Z>
  private final PC<? super Z> result2 = null;
  
  public C<? extends Z> proc3() { return result3; }
  private final PC<? extends Z> result3 = null;
}
==============
Comment 1 Philipe Mulet CLA 2004-10-28 12:14:13 EDT
Tuned wildcard equivalences.
Added regression test: GenericTypeTest#test352.
Fixed.
Comment 2 David Audel CLA 2004-11-04 09:46:02 EST
Verified for 3.1M3 with build I200411040100