Enums#250
Draft
andrewlock wants to merge 11 commits into
Draft
Conversation
Generate a `public const` field containing the bitwise OR of all defined enum values for enums marked with [Flags]. This enables compile-time access to the combined value of all flags, useful for defaults, initialization, and validation scenarios. Closes #240 (partially) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generate a `HasAnyFlags(this T value, T otherFlags)` method for enums marked with [Flags]. Returns true if any of the flags in otherFlags are set in value. When otherFlags is zero, returns true (consistent with Enum.HasFlag behavior). Partially addresses #247 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generate a `GetFlags(this T value, Span<T> buffer)` method for enums marked with [Flags]. Decomposes the value into individual set bits, writing each as a separate enum value into the caller-provided Span buffer and returning the count. Uses zero-allocation bit manipulation. Only emitted when Span<T> is available (netcoreapp2.1+, netstandard2.1+, or with System.Memory package). Partially addresses #247 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
No description provided.