Skip to content
Discussion options

You must be logged in to vote

You can use CallerArgumentExpressionAttribute to achieve this with a custom interpolated string handler:

public void AppendFormatted<T> (
    T value,
    int alignment,
    string? format,
    [CallerArgumentExpression("value")] string? name = null) { ... }

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@HaloFour
Comment options

@LokiMidgard
Comment options

Answer selected by 333fred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #7536 on September 14, 2023 12:45.