-
Notifications
You must be signed in to change notification settings - Fork 6k
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
C#: Allow ref this
#3958
Comments
Question for @jcouv Will either of these be targetting LangVersion=7.2 once they ship? |
Only the first one (order of There is also the by-val vs. |
This is being done in a community PR dotnet/roslyn#23533 |
Changing the title as this did not make the 7.3 release |
Closing pending acceptance of the feature. |
There are two related features that will affect the same documents:
ref this
(where onlythis ref
is allowed in 7.2) See Discussion: ref this vs this ref in ref extension methods (15.6, as a 7.2 bug fix) csharplang#1022ref
andpartial
modifiers. See Champion: relax ordering constraints aroundref
andpartial
modifiers on type declarations csharplang#946The first fixes a grammar issue with
ref
. Extension methods whose first argument is a struct type currently have to write that argument asref this T
. That looks clumsy and gives the wrong impression upon reading it.This work would allow
this ref T
as the preferred syntax.The second would relax the ordering constraint on
partial ref struct
.Neither would not introduce new articles, but would update the grammar for extension methods, argument modifiers, and ref value types.
The text was updated successfully, but these errors were encountered: