Skip to content

Change Enum.GetValues to AOT compatible call#190

Open
conniey wants to merge 1 commit intomicrosoft:masterfrom
conniey:aot
Open

Change Enum.GetValues to AOT compatible call#190
conniey wants to merge 1 commit intomicrosoft:masterfrom
conniey:aot

Conversation

@conniey
Copy link
Copy Markdown
Member

@conniey conniey commented Apr 7, 2026

Our team wants to use this package to parse KQL but a requirement is that packages must be AOT compatible. Currently, we get the warning when trying to publish AOT. This fixes that warning.

    D:\git\microsoft\Kusto-Query-Language\src\Kusto.Language\Syntax\SyntaxFacts.cs(775,25): 
    warning IL3050: Using member 'System.Enum.GetValues(Type)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. 
    It might not be possible to create an array of the enum type at runtime. 
    Use the GetValues<TEnum> overload or the GetValuesAsUnderlyingType method instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant