Skip to content

Enums#250

Draft
andrewlock wants to merge 11 commits into
mainfrom
feature/get-flags
Draft

Enums#250
andrewlock wants to merge 11 commits into
mainfrom
feature/get-flags

Conversation

@andrewlock
Copy link
Copy Markdown
Owner

No description provided.

andrewlock and others added 11 commits April 15, 2026 23:03
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>
@github-actions
Copy link
Copy Markdown

Test Results

0 files   -     216  0 suites   - 216   0s ⏱️ - 5h 45m 38s
0 tests  -  29 041  0 ✅  -  29 037  0 💤  -  4  0 ❌ ±0 
0 runs   - 512 731  0 ✅  - 512 659  0 💤  - 72  0 ❌ ±0 

Results for commit a8ade68. ± Comparison against base commit d3995b8.

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