Skip to content

Unable to compile constant declaration with self-referencing nameof expression #40

@controlflow

Description

@controlflow
const string N = nameof(N);

Currently this code won't compile because of:

error CS0110: The evaluation of the constant value for 'C.N' involves a circular definition

But there is no actual circular reference in evaluation of constant value.
I'm expecting this code to compile fine and constant N to have value "N".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions