Skip to content

Change Enum.GetValues to AOT compatible call#190

Closed
conniey wants to merge 1 commit into
microsoft:masterfrom
conniey:aot
Closed

Change Enum.GetValues to AOT compatible call#190
conniey wants to merge 1 commit into
microsoft: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.

@mattwar
Copy link
Copy Markdown
Contributor

mattwar commented Apr 21, 2026

We can't actually merge pull requests directly into this repo, as it is only a mirror of an internal Microsoft repo. However, I will make this fix for you.

@conniey
Copy link
Copy Markdown
Member Author

conniey commented Apr 27, 2026

@mattwar thank you!

@conniey conniey closed this Apr 27, 2026
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.

2 participants