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

Changes for ref-valued properties, indexers and methods #900

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

jskeet
Copy link
Contributor

@jskeet jskeet commented Aug 17, 2023

(This was originally in #837.)

The grammar has been extended to be as prescriptive as reasonably possible as befits a language specification[1], this means that former statements such as it being illegal to have a set accessor for a ref-valued property are now covered by the grammar. However the usual verbose description of the grammar remains!

The term ref-valued rather than ref-returning is used, a term closer to the language of fields. To distingush the two kinds of properties, which do follow different rules, the corresponding and somewhat ugly term non-ref-valued is used (non-ref-returning would be just as ugly).

[1] The grammar used by a compiler may be less restrictive to support more descriptive error messages, that is of course an implementation issue!

Fixes #825.

(This was originally in dotnet#837.)

The grammar has been extended to be as prescriptive as reasonably possible as befits a language specification[1], this means that former statements such as it being illegal to have a set accessor for a ref-valued property are now covered by the grammar. However the usual verbose description of the grammar remains!

The term ref-valued rather than ref-returning is used, a term closer to the language of fields. To distingush the two kinds of properties, which do follow different rules, the corresponding and somewhat ugly term non-ref-valued is used (non-ref-returning would be just as ugly).

[1] The grammar used by a compiler may be less restrictive to support more descriptive error messages, that is of course an implementation issue!

Fixes dotnet#825.
@jskeet jskeet requested a review from BillWagner August 17, 2023 10:38
@jskeet
Copy link
Contributor Author

jskeet commented Aug 17, 2023

@BillWagner: If you could approve and merge this, that'd be great. It's basically a rebased and squashed version of #837 (which has already been reviewed).

Copy link
Contributor

@Nigel-Ecma Nigel-Ecma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff’ed with #837, all looks good. @jskeet thanks for the “overnight” rebase

@jskeet jskeet merged commit 2a61cf4 into dotnet:draft-v7 Aug 17, 2023
@BillWagner
Copy link
Member

I just finished looking as well. Thanks @jskeet

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

Successfully merging this pull request may close these issues.

C# 7.3 method_body etc. grammar does not allow => ref
3 participants