RFR: 8322810: Lambda expression types can't be classes [v6]
Vicente Romero
vromero at openjdk.org
Fri Apr 11 00:25:28 UTC 2025
On Thu, 10 Apr 2025 21:10:32 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>>
>> minor error in condition
>
> test/langtools/tools/javac/lambda/ClassInIntersectionTypeTest.java line 32:
>
>> 30: static Class<? extends Annotation> myAnnoType() { return null; }
>> 31: @interface Anno {}
>> 32: Anno a = (Anno & Serializable) ()-> null; // annotations not allowed
>
> Actually, I wonder -- the annotation should not be allowed in any position right? Not just in the first type? E.g. since an annotation is an interface, you can also have:
>
> `Runnable & Anno1 & Anno2`
>
> Do we detect those?
I will add a test
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24548#discussion_r2038616643
More information about the compiler-dev
mailing list