-
Notifications
You must be signed in to change notification settings - Fork 4k
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
No error reported assigning through ref local of ref struct type after ref assigning parameter #62618
Comments
Is this the result of a spec bug? Or is it strictly an implementation bug? |
It's an implementation bug. |
I would actually expect the error on this line: rL = ref s; AFAIK ref-reassignment doesn't change the lifetime of the variable, and the value assignment below is an assignment of a local lifetime to a ref local lifetime. It's the conversion of outer ref to local ref in the value position (i.e. the |
We were looking through the span safety rules and they just seem to miss this case. This is the rule for ref reassignment:
This is effectively encoding that the scope of a
As such I agree the error is on the line |
Agreed, that's precisely the spec change I'd make as well. |
An escape error should be reported for the
rL = local
assignment.No errors are reported, with or without
-langversion:11
.The text was updated successfully, but these errors were encountered: