Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
This repository was archived by the owner on Nov 10, 2026. It is now read-only.

WhichAreReadOnly() and WhichAreRefStructs() filters and assertions for types #232

Description

@vbreuss

Why: readonly struct and ref struct (IsByRefLike) are distinct C# type modifiers with real semantic meaning — immutability and stack-only allocation, respectively. Convention tests that enforce "all value types in this layer must be readonly" have no clean way to express this today without a raw predicate. These fill the same role as the existing WhichAreSealed() / WhichAreAbstract() for value-type constraints.

Filter Assert (single) Assert (many)
readonly struct .WhichAreReadOnly() .IsReadOnly() .AreReadOnly()
ref struct .WhichAreRefStructs() .IsARefStruct() .AreRefStructs()

Activity

  1. added
    enhancement
    on May 31, 2026
  2. added theissue type on May 31, 2026
  3. github-actions commented on May 31, 2026

    @github-actions

    This is addressed in release v1.5.0.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementstate: released

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions