Skip to content

nameof doesn't work with extension properties #9654

@ds5678

Description

@ds5678

Version Used:

Visual Studio 17.14.0 Preview 7.0

Steps to Reproduce:

internal static class Extensions
{
    extension (object)
    {
        public static string Name => nameof(Name);
    }
}

Diagnostic Id:

CS0103: The name 'Name' does not exist in the current context

Expected Behavior:

I expect it to compile and return "Name";

Actual Behavior:

Only nameof(get_Name) compiles.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions