Bug 92556

Summary: [1.5][compiler] lower bound wildcard error
Product: [Eclipse Project] JDT Reporter: Nicolas Dumoulin <nicolas.dumoulin>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
the Test class none

Description Nicolas Dumoulin CLA 2005-04-25 04:55:06 EDT
Here is a piece of code that works with javac but throw an error in eclipse 
(3.1M6) 
 
public class Test { 
    public abstract class Context <N extends Number> { 
        private Strategy < N , ? super Context<N> > strategy; 
        public void setStrategy(Strategy < N , ? super Context<N> > strategy) 
{ 
            this.strategy = strategy; 
        } 
        // méthode qui utilise la stratégie 
        public N call() throws Exception { 
            return this.strategy.call(this); 
        } 
    } 
    public interface Strategy < N extends Number , C extends Context<N> > { 
        public abstract N call(C context); 
    } 
 
} 
 
The error is thrown at each line (two in fact) with the super keyword : 
Bound mismatch: The type ? super Test.Context<N> is not a valid  
 substitute for the bounded parameter <C extends Test.Context<N>> of  
 the type Test.Strategy<N,C>
Comment 1 Nicolas Dumoulin CLA 2005-04-25 04:57:02 EDT
Created attachment 20289 [details]
the Test class
Comment 2 Philipe Mulet CLA 2005-04-25 08:52:56 EDT
Added GenericTypeTest#test629.
Works fine in latest. Likely a dup of bug 81831