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

Revise grammar and syntax model for scoped #62983

Closed
jcouv opened this issue Jul 27, 2022 · 1 comment
Closed

Revise grammar and syntax model for scoped #62983

jcouv opened this issue Jul 27, 2022 · 1 comment

Comments

@jcouv
Copy link
Member

jcouv commented Jul 27, 2022

TL;DR: From LDM 7/27, we should write the language spec grammar for ref locals, ref fields, and scoped. Then we should consider how that affects our syntax model.

LDM expressed the desire to not put scoped into modifiers buckets, as modifiers can generally be re-ordered.
Instead scoped should be tied to the type. One proposal is to introduce type_modifiers following modifiers to hold scoped, ref and readonly in specific configurations.
This should take inspiration from Rex's spec draft for ref locals: dotnet/csharpstandard#213

Once that is done, we need to decide how to adjust our implementation.

  1. do we want to keep scoped in modifiers, or can we stick it into RefType (extending its meaning to "type with type modifiers"), or maybe introduce a new ScopedType?
  2. do we want to make use of that syntax model for new scenarios in parameters? (parameters don't currently make use of RefType and instead stick everything into modifiers for backcompat reasons)

Relates to test plan #59194

@jcouv jcouv added this to the 17.4 milestone Jul 27, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 27, 2022
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 28, 2022
@jcouv jcouv self-assigned this Jul 28, 2022
@cston
Copy link
Member

cston commented Sep 1, 2022

See dotnet/csharplang#6338 for proposed grammar.
See #61647 for ScopedTypeSyntax for locals, and for decision to use ParameterSyntax.Modifiers for scoped in parameters.

@jcouv jcouv removed their assignment Sep 30, 2022
@jaredpar jaredpar closed this as completed Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants