Skip to content

error CS8945 when using InterpolatedStringHandlerArgument with new extension block #78137

Open
@FaustVX

Description

@FaustVX

Version Used: C# 14 Preview 3

Steps to Reproduce:

I'm trying to convert my extensions to the new extension blocks, and I have encounter this error :

extension(ReadOnlyMemory<char> input)
{
    public bool TryParseFormated<T>(
      [InterpolatedStringHandlerArgument(nameof(input))] ParserInterpolatedHandler handler, // <- CS8945
      out T values, bool allowTrailling = false)
    { ... }
}

Diagnostic Id:
'input' is not a valid parameter name from 'StringExtensions.extension(ReadOnlyMemory<char>).TryParseFormated<T>(ParserInterpolatedHandler, out T, bool)'.[CS8945])

Actual Behavior:
The extension parameter isn't recognized by the attribute

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CompilersuntriagedIssues and PRs which have not yet been triaged by a lead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions