New and exciting error in the latest compiler
Sam Pullara
sam at sampullara.com
Sat Dec 29 21:39:00 PST 2012
Here is the code:
https://github.com/spullara/java-future-jdk8/blob/master/src/main/java/spullara/util/Currier.java
https://github.com/spullara/java-future-jdk8/blob/master/src/test/java/spullara/util/CurrierTest.java
Gives an ambiguity when I think it should be straightforward to pick the right one based on arity of the method reference:
error: reference to curry is ambiguous
both method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1) in Currier and method <T#2,U#2>curry(C1<T#2,U#2>,U#2) in Currier match
where T#1,U#1,V,T#2,U#2 are type-variables:
T#1 extends Object declared in method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1)
U#1 extends Object declared in method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1)
V extends Object declared in method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1)
T#2 extends Object declared in method <T#2,U#2>curry(C1<T#2,U#2>,U#2)
U#2 extends Object declared in method <T#2,U#2>curry(C1<T#2,U#2>,U#2)
error: reference to curry is ambiguous
both method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1) in Currier and method <T#2,U#2>curry(C1<T#2,U#2>,U#2) in Currier match
where T#1,U#1,V,T#2,U#2 are type-variables:
T#1 extends Object declared in method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1)
U#1 extends Object declared in method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1)
V extends Object declared in method <T#1,U#1,V>curry(C2<T#1,U#1,V>,U#1)
T#2 extends Object declared in method <T#2,U#2>curry(C1<T#2,U#2>,U#2)
U#2 extends Object declared in method <T#2,U#2>curry(C1<T#2,U#2>,U#2)
And those error messages have to be fixed, they are brutal :)
Sam
More information about the lambda-dev
mailing list