Bug 179902

Summary: [1.5][compiler] javac "Bound mismatch" on generics construct javac (1.5 and 1.6) is happy with
Product: [Eclipse Project] JDT Reporter: Zorzella Mising name <zorzella>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: david_audel, philippe_mulet
Version: 3.3   
Target Milestone: 3.3.2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Zorzella Mising name CLA 2007-03-28 23:43:09 EDT
Build ID: I20070323-1616

Steps To Reproduce:
This excerpt:

class Foo<F extends Enum<F>> {
  
  class Bar<B> {
    Bar(Foo<? extends B> bar) {}
  }
}

Yields this error, even though javac (1.6 and 1.5) is happy:

Bound mismatch: The type ? extends B is not a valid substitute for the bounded parameter <F extends Enum<F>> of the type Foo<F>
Comment 1 Kent Johnson CLA 2007-06-08 13:43:59 EDT
I don't see why B should be a valid substitue for Enum<F>, since B does not have any bounds that would match an Enum.

How did you instantiate Foo.Bar ?
Comment 2 Philipe Mulet CLA 2007-09-13 18:42:17 EDT
Fixed along with bug 202404.
Added GenericTypeTest#test1167

*** This bug has been marked as a duplicate of bug 202404 ***
Comment 3 David Audel CLA 2007-09-18 06:28:59 EDT
Verified for 3.4M2 using build I20070918-0010
Comment 4 Frederic Fusier CLA 2008-01-24 07:08:45 EST
Verified for 3.3.2 using build M20080123-0800.