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

Checks around ref & ref readonly required. #836

Closed
Nigel-Ecma opened this issue Jul 5, 2023 · 2 comments
Closed

Checks around ref & ref readonly required. #836

Nigel-Ecma opened this issue Jul 5, 2023 · 2 comments
Labels
meeting: discuss This issue should be discussed at the next TC49-TG2 meeting
Milestone

Comments

@Nigel-Ecma
Copy link
Contributor

Nigel-Ecma commented Jul 5, 2023

Adding this as an issue so it’s checked off before v7.

Recent issues have brought to light that the introduction of ref and ref readonly into v7 is unfortunately incomplete and where they are allowed and the rules governing them need to be checked to ensure v7 makes sense in this area.

Recent issues, and PRs if applicable, concerning ref & ref readonly:

Issues not covered by PRs:

  • Rules over assigning to ref & ref readonly variables should be checked for completeness (C# 7 §13.6.2 ref readonly in local_variable_initializer #828 suggests that some source material may have been sourced from earlier feature proposals and may not reflect the final intended semantics).
  • Similarly rules for combining ref and ref readonly, e.g. when a selection expression has ref & ref readonly choices, need to be checked.

ref, a little word with a big impact!

The above list may not be exhaustive, please add to it if needed!

Of the existing PRs only one is “in progress” right now, next other two are in my queue – feel free to dive in and take an reassign, but maybe consider checking the rules for validity as that is not covered by any PR (and of course may produce none!)

@Nigel-Ecma Nigel-Ecma added this to the C# 7.x milestone Jul 5, 2023
@jskeet jskeet added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Jul 11, 2023
@Nigel-Ecma
Copy link
Contributor Author

Issue #894 has highlighted some more issues not mentioned above regarding read-only, e.g. passing a variable as a ref parameter does not specify that the variable cannot be read-only (note in is similar to ref readonly)

@jskeet
Copy link
Contributor

jskeet commented Sep 6, 2023

Meeting 2023-09-06: Closing in favour of the specific examples in #894; there may well still be some things we've missed, but ultimately that will always be the case.

@jskeet jskeet closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting: discuss This issue should be discussed at the next TC49-TG2 meeting
Projects
None yet
Development

No branches or pull requests

2 participants