Skip to content

Test plan for "unmanaged generic structs" #31374

@jcouv

Description

@jcouv

Proposal: dotnet/csharplang#1744

This issue is a place to collect test ideas and track their validation. Use the compiler test plan as a tool for brainstorming.

  • validate with LangVersion 7.3
  • test with tuple type (SO thread) Issue with tuples and unmanaged constraint #32103
  • write speclet (contained under Design section of proposal)
  • [ ] update compiler test plan (doesn't appear to be anything to add)
  • test public API IsUnmanagedType in new scenarios
  • Test for ref structs
  • Test the IsManagedType API as suggested by Julien
  • Test moveability (existing rules should be sufficient)
  • Have at least one test spit some IL to look at and have a few tests run with "expected output" to make sure the CLR can handle the code.
  • Stackalloc array of items
  • (Mutually) Recursive struct definition
    • Also check the IsUnmanagedType API for these
  • Fixed-size buffer inside generic struct
  • Also check across metadata (metadata struct definition has private object or unmanaged field)
    • Also private T field
  • For all places unmanaged type is required, we should have a test that covers that code path and ensures that the required feature diagnostic is produced at language version < 8.0
    • addressOf &
    • fixed with address of field
    • fixed with array of generic structs
    • sizeof
    • stackalloc with size
    • implicit stackalloc with initializer
    • field of type pointer to unmanaged generic struct
    • unmanaged constraint

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions