-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Disallow ref field to ref struct #62186
Conversation
.class public sealed R2 extends [mscorlib]System.ValueType | ||
{ | ||
.custom instance void [mscorlib]System.Runtime.CompilerServices.IsByRefLikeAttribute::.ctor() = (01 00 00 00) | ||
.field public valuetype R1& F |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated: do we give a use-site error when a non-ref struct
contains a ref field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we give a use-site error when a non-
ref struct
contains a ref field?
No, we're not reporting a use-site error for use of such a field currently. There is an item in the test plan, and I'll add this in a follow-up PR.
Do we have an issue tracking the work to re-enable this scenario? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 1)
|
Disallow
ref
fields ofref struct
type, to simplify escape analysis.Relates to test plan #59194