Repository navigation
Support AssociatedEnum annotation on parameters and fields - #1856
Closed
Jevan Saks (jevansaks) wants to merge 1 commit into
Closed
Jevan Saks (jevansaks) wants to merge 1 commit into
Jevan Saks (jevansaks) wants to merge 1 commit into
Conversation
Project ABI-compatible enum storage directly for native signatures and buffer elements. Preserve native-backed scalar field properties and report PInvoke015 with native fallback for incompatible metadata. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 551c26b9-812d-47f4-9c39-9fd3344e17ce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AssociatedEnumannotations directly as enum types when the enum's declared underlying type matches the native storage, including signedness.PInvoke015for incompatible associations and preserve the native types. Enum underlying types, members, values, and flags are never rewritten.Compatibility
Some existing Windows metadata annotations disagree with their associated enums' storage. Those sites now expose their original native integer types instead of converting enum views, so affected callers may need explicit casts until the metadata is corrected.
Coverage
Includes all eight integral enum storage types, x86/x64/ARM64 projections, request-order independence, namespace/reference resolution, fixed and flexible arrays, warning delivery through both generation frontends, actual
LibraryImportgeneration, and an executed COM ABI check.Replaces #1855 with a standalone change from an in-repository branch targeting
main. SafeHandle ownership changes and the unrelated compatibility harness are excluded.