Bug 75328 - [1.5][wildcards] Bound Mismatch for ? type
Summary: [1.5][wildcards] Bound Mismatch for ? type
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-09-29 14:08 EDT by Bart Geraci CLA
Modified: 2004-11-04 07:30 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-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