Community
Participate
Working Groups
Created attachment 237696 [details] Test case. I've included a test case demonstrating the issue. Given the following type signatures, I'm able to compile and run the code under Maven with both JDK 6 and JDK 7, but Eclipse gives a "Bound mismatch: The type F is not a valid substitute for the bounded parameter <F extends Field<TP,F>> of the type Field<TP,F>" error on both TupleVisitor and the anonymous implementation of TupleVisitor in SanityTest.java. public abstract class Tuple<F extends Field<TP, F>, TP extends Tuple<F, TP>> public class VariableTuple<F extends Field<VariableTuple<F>, F>> extends Tuple<F, VariableTuple<F>> public class ConstantTuple<F extends Field<ConstantTuple<F>, F>> extends Tuple<F, ConstantTuple<F>> public class Field<TP extends Tuple<F, TP>, F extends Field<TP, F>> public static class ConstantField extends Field<ConstantTuple<ConstantField>, ConstantField> public static class VariableField extends Field<VariableTuple<VariableField>, VariableField> public interface TupleVisitor { public <F extends Field<VariableTuple<F>, F>> void visit(VariableTuple<F> tuple, F field); public <F extends Field<ConstantTuple<F>, F>> void visit(ConstantTuple<F> tuple, F field); }
Verified that issue also exists in 4.3.0.
For context: http://stackoverflow.com/questions/20201731/eclipse-generics-issue-workaround?noredirect=1#comment30121391_20201731
As a first step, let us assess if this is a regression or a long standing issue, so we will know where to slot this in relative to Java 8 work. Thanks.
(In reply to Srikanth Sankaran from comment #3) > As a first step, let us assess if this is a regression or a long standing > issue, so we will know where to slot this in relative to Java 8 work. Thanks. Bug has been present since 3.2.2. Up-to 3.8 we reported three similar errors per method in TupleVisitor, starting with 4.3M5a we're down to one per method. Apparently we have fixed something in that milestone, perhaps the fix just needs to be extended.
(In reply to Stephan Herrmann from comment #4) > [...] > starting with 4.3M5a we're down to one per method. > Apparently we have fixed something in that milestone, Likely candidate: bug 395002.
Still occurs with 4.7 M1, reported errors are: ---------- 1. ERROR in /tmp/sandbox/src/main/java/org/roxton/TupleVisitor.java (at line 4) public <F extends Field<VariableTuple<F>, F>> void visit(VariableTuple<F> tuple, F field); ^ Bound mismatch: The type F is not a valid substitute for the bounded parameter <F extends Field<VariableTuple<F>,F>> of the type VariableTuple<F> ---------- 2. ERROR in /tmp/sandbox/src/main/java/org/roxton/TupleVisitor.java (at line 6) public <F extends Field<ConstantTuple<F>, F>> void visit(ConstantTuple<F> tuple, F field); ^ Bound mismatch: The type F is not a valid substitute for the bounded parameter <F extends Field<ConstantTuple<F>,F>> of the type ConstantTuple<F> ---------- 2 problems (2 errors)
bulk move out of 4.8
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.