Skip to content

Is there any way we could make use of CallerArgumentExpressionAttribute? #3936

Closed
@Dreamescaper

Description

@Dreamescaper

C#10 has a nice addition of CallerArgumentExpressionAttribute, which we could use to print actual argument expression in error messages.

I can see two problems though:

  • We need to add optional string parameter to methods. But we already have overloads with message string parameter.
  • We have methods with params parameter. And we can't combine params and optional parameters in the same method.

Is there any way we could make use of this attribute?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions