-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b143
-
Verified
>
> javac started rejecting the following program between 9-ea+119 and 9-ea+120. The culprit appears to beJDK-8157149 [1][2]. Was this intentional?
>
> Thanks,
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8157149
> [2] http://hg.openjdk.java.net/jdk9/dev/langtools/rev/a8b7c9938b74
>
> === Test.java
> abstract class Test {
> interface W<A> {}
> abstract <B> B f(W<B> e);
> abstract <C> C g(C b, long i);
>
> void h(W<Long> i) {
> g("", f(i));
> }
> }
> ===
>
> $ javac Test.java
> ...
> error: method g in class Test cannot be applied to given types;
> g("", f(i));
> ^
> required: C,long
> found: String,Long
> reason: cannot infer type-variable(s) C,B
> (argument mismatch; B cannot be converted to long)
> where C,B are type-variables:
> C extends Object declared in method <C>g(C,long)
> B extends Object declared in method <B>f(W<B>)
> 1 error
> javac started rejecting the following program between 9-ea+119 and 9-ea+120. The culprit appears to be
>
> Thanks,
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8157149
> [2] http://hg.openjdk.java.net/jdk9/dev/langtools/rev/a8b7c9938b74
>
> === Test.java
> abstract class Test {
> interface W<A> {}
> abstract <B> B f(W<B> e);
> abstract <C> C g(C b, long i);
>
> void h(W<Long> i) {
> g("", f(i));
> }
> }
> ===
>
> $ javac Test.java
> ...
> error: method g in class Test cannot be applied to given types;
> g("", f(i));
> ^
> required: C,long
> found: String,Long
> reason: cannot infer type-variable(s) C,B
> (argument mismatch; B cannot be converted to long)
> where C,B are type-variables:
> C extends Object declared in method <C>g(C,long)
> B extends Object declared in method <B>f(W<B>)
> 1 error
- relates to
-
JDK-8157149 Inference: weird propagation of thrown inference variables
-
- Closed
-