Bug 75328

Summary: [1.5][wildcards] Bound Mismatch for ? type
Product: [Eclipse Project] JDT Reporter: Bart Geraci <BJGeraci>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Bart Geraci CLA 2004-09-29 14:08:28 EDT
Using 3.1M2 and java 1.5.0-rc:

Given 2 files:
------
Intf.java:
public interface Intf<D extends Comparable<D>, I extends Comparable<D>> { 
  public void f(Intf<D,?> val);
}

Impl.java:
public class Impl <M extends Comparable<M>, P extends Comparable<M>>
  implements Intf<M,P> {

  public void f(Intf<D,?> val) { } 
}
---------
I get an error message at the "?" character in definition of f in Impl.java:

  Bound mismatch: The type ? is not a valid substitute for the bounded parameter
<I extends Comparable<D>> of the type Intv<D,I>

It compiles without warning or error using sun compiler.
Comment 1 Bart Geraci CLA 2004-09-29 14:11:00 EDT
[Errata] Error message said "Intf<D,I>" (not "Intv<D,I>")
Comment 2 Frederic Fusier CLA 2004-10-27 13:29:35 EDT
Using HEAD, we still have this error message:
----------
1. ERROR in D:\usr\OTI\workspaces\dvpt\v31\HEAD\_Bug\Impl.java (at line 4)
	public void f(Intf<M,?> val) { } 
	                     ^
Bound mismatch: The type ? is not a valid substitute for the bounded parameter
<I extends Comparable<D>> of the type Intf<D,I>
----------
1 problem (1 error)
Comment 3 Philipe Mulet CLA 2004-10-28 10:55:51 EDT
Tuned semantics for variable boundcheck (unbound wildcard scenario).
Added regression test: GenericTypeTest#test351

Fixed
Comment 4 David Audel CLA 2004-11-04 07:30:10 EST
Verified for 3.1M3 with build I200411040100