Thanks to visit codestin.com
Credit goes to github.com

Skip to content

@nameof compiles incorrectly in mcs #6829

@rolfbjarne

Description

@rolfbjarne

Steps to Reproduce

Test case:

class M {
	static void Main (string[] args) {
		System.Console.WriteLine (@nameof (args));
	}
}

Compiles fine with mcs:

$ mcs test.cs

but not so much with csc:

$ csc test.cs
test.cs(3,29): error CS0103: The name 'nameof' does not exist in the current context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions