Details
-
Bug
-
Resolution: Fixed
-
P3
-
8, 8-repo-lambda
-
b100
-
Verified
Description
This program fails to compile:
import java.util.Map;
class TestData<X,Y> { }
interface Foo<X, Y extends Foo<X, Y>> { }
interface IntFoo extends Foo<Integer, IntFoo> { }
interface Function<X, Y> {
Y apply(X x);
}
class Test {
void test(TestData<Integer, IntFoo> data) {
m(data, s->s);
}
<E, E_OUT extends Foo<E, E_OUT>, W, W_IN extends Foo<W, W_IN>> void m(TestData<W, W_IN> data, Function<W_IN, E_OUT> m) { }
}
Note: if inference variable in the 'm' method are swapped, so that W, W_IN come first, the program compiles.
import java.util.Map;
class TestData<X,Y> { }
interface Foo<X, Y extends Foo<X, Y>> { }
interface IntFoo extends Foo<Integer, IntFoo> { }
interface Function<X, Y> {
Y apply(X x);
}
class Test {
void test(TestData<Integer, IntFoo> data) {
m(data, s->s);
}
<E, E_OUT extends Foo<E, E_OUT>, W, W_IN extends Foo<W, W_IN>> void m(TestData<W, W_IN> data, Function<W_IN, E_OUT> m) { }
}
Note: if inference variable in the 'm' method are swapped, so that W, W_IN come first, the program compiles.