Bug 92556 - [1.5][compiler] lower bound wildcard error
Summary: [1.5][compiler] lower bound wildcard error
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-25 04:55 EDT by Nicolas Dumoulin CLA
Modified: 2005-04-25 08:52 EDT (History)
0 users

See Also:


Attachments
the Test class (584 bytes, text/x-java)
2005-04-25 04:57 EDT, Nicolas Dumoulin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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