Type-variable references from local interface declaration
Vicente Romero
vicente.romero at oracle.com
Wed Jun 17 19:40:57 UTC 2020
Hi Tagir,
Thanks for the report, I have created [1] to address this issue,
Vicente
[1] https://bugs.openjdk.java.net/browse/JDK-8247790
On 6/15/20 7:38 AM, Tagir Valeev wrote:
> 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