RFR 8200452: Jextract failed to produce enum constants for anonymous enums
Sundararajan Athijegannathan
sundararajan.athijegannathan at oracle.com
Tue Apr 3 04:23:53 UTC 2018
+ public boolean isAnonymousEnum() {
+ // libclang::clang_Cursor_isAnonymous only applies to struct, not enum
+ if (type().kind() == TypeKind.Enum) {
+ return spelling().isEmpty()&&
+ type().spelling().startsWith("enum (anonymous");
+ }
+ return false;
+ }
+
Is it possible for check something else that is more stable than
implementation aspect ("enum (anonymous")? How about Java
non-identifier character presence or something like that?
-Sundar
On 03/04/18, 9:40 AM, Henry Jen wrote:
> Hi,
>
> Please review the webrev[1] for 8200452[2]. The patch add constant int into the main interface is the enum is complete anonymous, otherwise, it was created as an type annotation of int with all enum constants in it.
>
> Cheers,
> Henry
>
> [1] http://cr.openjdk.java.net/~henryjen/panama/8200452/webrev/
> [2] https://bugs.openjdk.java.net/browse/JDK-8200452
>
>
>
>> On Mar 29, 2018, at 12:11 PM, Henry Jen<henry.jen at oracle.com> wrote:
>>
>> Thanks, this fix part of the issue we encountered with anonymous enum.
>>
>> I filed a bug JDK-8200452[1] for various cases, we need to have a better strategy for naming anonymous enum, particularly when without typedef.
>>
>> Cheers,
>> Henry
>>
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8200452
>>
>>> On Mar 27, 2018, at 10:00 PM, Sundararajan Athijegannathan<sundararajan.athijegannathan at oracle.com> wrote:
>>>
>>> Please review.
>>>
>>> Webrev: http://cr.openjdk.java.net/~sundar/jextract_anonymous_enum/webrev.00/
>>>
>>> Thanks,
>>> -Sundar
More information about the panama-dev
mailing list