Skip to content

Test plan for CallerArgumentExpressionAttribute #52745

@jcouv

Description

@jcouv

Proposal: dotnet/csharplang#287
Spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/caller-argument-expression.md

General Concerns

  • LangVersion - No lang version impact for caller info attributes.
  • VB Interop
    • VB does case-insensitive identifier matching
    • VB emits correct casing, regardless of user's casing in source
  • Update spec with implicit conversion rules
  • Remove feature flag after Aleksey reviews.

Semantics

  • Syntax is reflected exactly
    • Leading comments ignored
    • Trailing comments ignored
    • Middle comments included
    • Leading pragmas ignored
    • Trailing pragmas ignored
    • Middle pragmas included
  • Parameter remapping
    • Extension methods
      • Info of this parameter
      • Info of non-this parameter
    • Delegate Invoke
    • Delegate BeginInvoke
    • Delegate EndInvoke
  • Overridden by existing caller info attributes
    • CallerFilePathAttribute
    • CallerLineNumberAttribute
    • CallerMemberNameAttribute
  • Self-referential attribute
  • Explicit argument reordering
  • Applied multiple times
  • Invalid parameter name
  • No default value provided for parameter
  • Referenced parameter uses default value
  • Attribute added to overridden method
  • Attribute removed from overridden method
  • Attribute applied to type with implicit conversion from string
    • Reference conversion
    • User-defined conversion
    • No conversion
  • Compiler generated calls with user-written code
    • Extension GetEnumerator
    • Extension Deconstruct
    • Implicit Index/Slice (should be default)
    • Extension GetAwaiter
  • Ref/out parameters
    • Out variable declarations
    • Out discards
  • Implicit base constructor calls (should be ignored, like other Caller info attributes)

Open issues:

  • could we add CallerArgumentExpression to Debug.Assert and have that new overload get picked?

FYI @Youssef1313

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions