Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression precedence table in introduction missing nameof(x) #13

Closed
bbarry opened this issue Feb 1, 2017 · 4 comments
Closed

expression precedence table in introduction missing nameof(x) #13

bbarry opened this issue Feb 1, 2017 · 4 comments
Labels

Comments

@bbarry
Copy link
Contributor

bbarry commented Feb 1, 2017

https://github.com/dotnet/csharplang/blob/master/spec/introduction.md#expressions

|                                  | `default(T)`      | Obtain default value of type `T` |
|                                  | `delegate {...}`  | Anonymous function (anonymous method) |

should be

|                                  | `default(T)`      | Obtain default value of type `T` |
|                                  | `nameof(x)`       | Obtain the name of `x` as a constant string |
|                                  | `delegate {...}`  | Anonymous function (anonymous method) |
@MadsTorgersen
Copy link
Contributor

Thanks, good catch!

Since this isn't yet authoritative source, I'll keep these spec defects around for later application.

@gafter
Copy link
Member

gafter commented Feb 9, 2017

Not sure how much it is needed. Syntactically, a nameof expression is treated as an invocation expression.

@bbarry
Copy link
Contributor Author

bbarry commented Feb 9, 2017

The elvis operators are also missing (I'm not entirely sure how to even bring that up; are they unary in this table based on this?). I suppose it comes down to whether the table here is an authoritative source vs a high level summary of the language's expressions.

Syntactically to the rest of the spec nameof doesn't seem much different than checked(x), unchecked(x) or default(T) which are all in the table except for the quirk where it might not be a keyword and then becomes an invocation expression.

@BillWagner
Copy link
Member

I'm closing this. This entire clause has been removed from the C# standard in V5. The new expressions are added in the expressions chapter in the correct location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants