Type-variable references from local interface declaration
Tagir Valeev
amaembo at gmail.com
Mon Jun 15 11:38:24 UTC 2020
Hello!
The spec draft for local interfaces and enums [1] tells that it's
illegal to refer to the enclosing method type parameter from the local
interface. Here's a simplified sample from the spec:
class Box<T> {
static <U> Box<U> make(U val) {
interface Checker {
void check(U val); // compile-time error
}
return null;
}
}
However, it's successfully compilable using javac 15-ea+26-1287. I
believe, either spec or implementation should be adjusted.
With best regards,
Tagir Valeev.
[1] http://cr.openjdk.java.net/~gbierman/jep384/jep384-20200506/specs/local-statics-jls.html#jls-6.5.5.1
More information about the amber-dev
mailing list