Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Plan for "Inline Arrays" feature #67826

Open
AlekseyTs opened this issue Apr 14, 2023 · 0 comments
Open

Test Plan for "Inline Arrays" feature #67826

AlekseyTs opened this issue Apr 14, 2023 · 0 comments

Comments

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Apr 14, 2023

Championed proposal: dotnet/csharplang#7431
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-12.0/inline-arrays.md
Feature branch: https://github.com/dotnet/roslyn/tree/features/InlineArrays

Compiler

  • language version
  • runtime support required *_RuntimeSupport
  • update compiler test plan
  • as local
  • as parameter including ref, in, out
  • as return type
  • as field or property
    • in class, struct
    • as ref, ref readonly field
  • in array
  • in span
  • as type argument
  • inline array type
    • non-generic, generic
    • multiple attributes InlineArrayType_04_MultipleAttributes
    • Length <= 0 InlineArrayType_*_WrongLength
    • no fields InlineArrayType_09_NoFields
    • multiple fields (including from event, property, primary constructor) InlineArrayType_08_MoreThanOneField
    • static fields InlineArrayType_*StaticField*
    • ref field InlineArrayType_*_RefField
    • class, interface, delegate, enum
    • nested struct InlineArrayType_31_Nested, InlineArrayType_*_Generic
    • ref struct
    • retargeting InlineArrayType_18_Retargeting
    • [StructLayout(...)]
    • with explicit indexer
    • [Required] attribute on element field
  • inline array element type
    • inline array
    • ref struct (error)
    • pointer InlineArrayType_30_UnsupportedElementType
  • conversions Conversion_*
    • implicit conversion to Span<T> for writable variables only
    • implicit conversion to ReadOnlySpan<T> for variables only
    • no conversion for values Conversion_Value_*
    • standard conversion (participates in user-defined conversion) Conversion_Standard_*
  • element access: inlineArray[index]
    • arg type:
      • implicitly convertible to int
      • dynamic ElementAccess_Dynamic_Variable_01
      • System.Index
    • index < 0, index >= Length with constants and non-constants, int and System.Index ElementAccess_Bounds_*
    • ref, in, out index (error) RefOutInIndex
    • element access of writable variable ElementAccess_Variable_*
      • int and System.Index
      • as value, ref, ref readonly
      • ref safety
    • element access of readonly variable (including readonly context) ElementAccess_*ReadOnlyContext_*
      • int and System.Index
      • as value, ref, ref readonly
      • ref safety
    • element access of value ElementAccess_Value_*
      • int and System.Index
      • as value, ref, ref readonly
      • ref safety
    • within async methods ElementAccess_Await_*
    • in object initializer ElementAccess_ObjectInitializer_*
    • explicit indexer ignored *_IndexerIsIgnored_*
  • slice: inlineArray[range]
    • start < 0, end >= Length with constants and non-constants Slice_Bounds_*
    • slice of writable variable Slice_Variable_*
      • element access as value, ref, ref readonly
      • ref safety
    • slice of readonly variable (including readonly context) Slice_ReadOnlyContext_*
      • element access as value, ref, ref readonly
      • ref safety
    • slice of value (error)
    • within async methods Slice_Await_*
    • omit slice call if range is a constant and start is 0
    • explicit Slice() method ignored *_SliceMethodIsIgnored_*
  • indexer: prefer int over Index over Range Access_ArgumentType_*
  • as foreach collection Foreach_*
    • writable variables, readonly variables, values
    • foreach ... ref, foreach ... ref readonly
    • await foreach
    • in async method Foreach_InAsync_*
  • conditional access *_ConditionalAccess_*
    • inlineArray?[i] where i is int, Index, Range
    • type?InlineArray[i] where type is class, struct, i is int, Index, Range
  • list pattern is [..] (error) ListPattern
  • collection literals Support inline arrays with collection literals #68927
    • as collection literal target type
    • as collection literal spread element
  • in expression tree (error)
    • element access ElementAccess_ExpressionTree_01
    • conversion Conversion_ExpressionTree_01
  • definite assignment DefiniteAssignment_*
    • unassigned vs. new()
    • 1 element vs. > 1 element
    • = default;
    • definite assignment errors for element access
    • definite assignment errors for slice
    • definite assignment errors for implicit conversions to spans
    • definite assignment errors within inline array type
  • nullable analysis NullableAnalysis_*
  • missing types and methods MissingHelper_*
    • Span<T>, ReadOnlySpan<T>
    • System.Index, System.Range
    • MemoryMarshal.*, Unsafe.*
  • PrivateImplementationDetails methods created as needed PrivateImplementationDetails_*
    • InlineArrayAsSpan(), ...AsReadOnlySpan()
    • InlineArrayElementRef(), ...RefReadOnly()
  • attribute cycles CycleThroughAttributes_*
  • Test element access with an int variable as an index
  • Test with types and members synthesizing fields

Public API

IDE

@AlekseyTs AlekseyTs self-assigned this Apr 14, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 14, 2023
@AlekseyTs AlekseyTs removed the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 14, 2023
@jaredpar jaredpar added this to the 17.8 milestone Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants