javac9 and lower bounded wildcards
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jan 12 14:32:09 UTC 2015
I Liam,
this is related to this bug:
https://bugs.openjdk.java.net/browse/JDK-8033718
Fixing that type-system issue caused some most specific issues - this is
being tracked here:
https://bugs.openjdk.java.net/browse/JDK-8039214
We are aware of the problem and are working on it.
Maurizio
On 09/01/15 18:14, Liam Miller-Cushon wrote:
> This is a bug, right? It reproduces with javac9-dev at head, and might
> be related to JDK-8067858.
>
> ===
> import java.util.*;
>
> abstract class Test {
> abstract <T> void f(Collection<? super T> i);
> abstract <T> void f(List<? super T> i);
>
> <T> void m(List<T> a) {
> f(a);
> }
> }
> ===
>
> Test.java:8: error: reference to f is ambiguous
> f(a);
> ^
> both method <T#1>f(Collection<? super T#1>) in Test and method
> <T#2>f(List<? super T#2>) in Test match
> where T#1,T#2 are type-variables:
> T#1 extends Object declared in method <T#1>f(Collection<? super T#1>)
> T#2 extends Object declared in method <T#2>f(List<? super T#2>)
More information about the compiler-dev
mailing list