Skip to content

Test plan for "collection expression arguments" feature #80613

@jcouv

Description

@jcouv

Championed proposal: dotnet/csharplang#8887
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/collection-expression-arguments.md

Compiler:

Errors

  • LangVer behavior LanguageVersion_*
  • Obsolete members
    • CollectionBuilder CollectionBuilder_ObsoleteBuilderMethod_*
    • constructor CollectionInitializer_ObsoleteConstructor_*
  • Compiler feature required members
    • CollectionBuilder CollectionBuilder_UseSiteError_Method
    • constructor Constructor_UseSiteError_Method
  • UnmanagedCallersOnly
    • CollectionBuilder CollectionBuilder_UnmanagedCallersOnly
  • Type with required properties WithElement_RequiredProperties
  • Non-accessible construction
    • CollectionBuilder CollectionBuilder_Private|Internal|ProtectedMethod
    • Constructor WithElement_Private|Protected|etcConstructor*
  • File local CollectionBuilder type - CollectionBuilderFileLocalType1
  • File local CollectionBuilder parameter type - CollectionBuilderFileLocalType2
  • Dynamic
    • Parameters
      • CollectionBuilder - WithElement_CollectionBuilder_DynamicParameters
      • constructor DynamicArguments_04
    • Arguments
      • CollectionBuilder - WithElement_CollectionBuilder_DynamicArguments
      • constructor DynamicArguments_*
  • Disallowed on array and span types CollectionExpressionTests_WithElement_ArraysAndSpans
  • with in params: M(with(A, B), C, D) (disallowed)
  • update BindCollectionExpressionForErrorRecovery. Tested in TestErrorRecovery_XXX in IOperationTests_ICollectionExpressionOperation.
  • Expression trees ExpressionTreeInWithElement
  • Type parameter constraints
    • CollectionBuilder CollectionBuilder_MultipleBuilderMethods_GenericConstraints*, CollectionBuilder_GenericConstraints
    • constructor WithElement_TypeConstraints*
  • Ref safety
    • CollectionBuilder RefSafety_CollectionBuilderArguments
    • constuctor RefSafety_ConstructorArguments
  • Errors for unsupported for IList and ICollection parameters IList_With_OptionalParamsAfterCapacity

Behavior

  • order of evaluation
    • CollectionBuilder EvaluationOrder_CollectionInitializer*
    • constructor EvaluationOrder_CollectionInitializer
  • Parameter modifiers
    • ref
      • CollectionBuilder CollectionBuilder_RefParameter
      • constructor WithElement_RefParameters
    • out
      • CollectionBuilder CollectionBuilder_OutParameter
      • constructor WithElement_OutParameters
    • in
      • CollectionBuilder CollectionBuilder_InParameter
      • constructor WithElement_InParameters
    • ref readonly
      • CollectionBuilder CollectionBuilder_RefReadonlyParameter
      • constructor - WithElement_RefReadonlyParameter
    • params
      • CollectionBuilder lots of tests
      • constructor WithElement_Params
    • scoped
      • CollectionBuilder RefSafety_CollectionBuilderArguments
      • constructor RefSafety_ConstructorArguments
    • UnscopedRef
      • CollectionBuilder - WithElement_CollectionBuilder_UnscopedRef
      • constructor WithElement_RefParameters, WithElement_UnscopedRef
  • Default parameters
    • CollectionBuilder CollectionBuilder_OptionalParameter*
    • constructor CollectionInitializer_OptionalParameter*
  • nullability analysis - All in CollectionExpressionTests_WithElement_Nullable.cs
    • CollectionBuilder
    • constructor
  • __arglist
    • CollectionBuilder - WithElement_CollectionBuilder_ArgList
    • constructor Arglist*
  • interpolation handlers
    • CollectionBuilder - InterpolatedStringHandler_CollectionBuilder
    • constructor InterpolatedStringHandler
  • If you add a new expression that can be nested inside itself, test deeply nesting it. Potentially cut off direct nesting. (N/A. Can't nest this directly deeply).
  • Overload resolution
    • CollectionBuilder CollectionBuilder_MultipleBuilderMethods_GenericConstraints*
    • constructor WithElement_OverloadResolution*, WithElement_NoMatchingConstructor, WithElement_Constructor_UserDefinedConversion*, WithElement_IncorrectConstructorType
  • ORPA
    • CollectionBuilder CollectionBuilderOverloadResolutionPriority
    • constructor OverloadResolutionPriority
  • Support for IList and ICollection capacity: parameter IList_With_* (covers both IList and ICollection)

Public APIs

IDE

  • completion - WithKeywordRecommenderTests.TestInCollectionExpressionX
  • colorization - TotalClassifierTest.TestWithElement
  • QuickInfo - SemanticQuickInfoSourceTests.TestWithElementXXX
  • formatting - FormattingTests.FormatWithElementX
  • GoToDef on with - CSharpGoToDefinitionTests.TestCSharpGoToWithElementXXX
  • signature/parameter info while typing in with - WithElementSignatureHelpProviderTests
  • FAR on constructor or Create method used by with - Not planned.

Sub-issues

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions