-
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
Auto-default ref fields with a null ref-assignment #63065
Conversation
@@ -12592,5 +12592,198 @@ public void ScopedReserved_Alias_Escaped() | |||
Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @scoped = System.Int32;").WithLocation(1, 1) | |||
); | |||
} | |||
|
|||
[Fact, WorkItem(63018, "https://github.com/dotnet/roslyn/issues/63018")] | |||
public void InitRefField_AutoDefault() |
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.
Consider moving above ScopedReserved_*
tests, to avoid a conflict with #62783. #Resolved
@cston FYI, I skipped one test following integration with runtime flag change (that test needs to use Net60 framework and use the test hook...). |
@dotnet/roslyn-compiler for second review. Thanks |
@dotnet/roslyn-compiler for second review. Thanks |
Vlad mentioned that the
fixed
statement can null-out references. Found that code inLocalRewriter_FixedStatement.cs
and factored it out into aNullRef
helper.This is emitted using the same IL as
ref T Unsafe.NullRef<T>()
, namelyldc.i4.0
followed byconv.u
.No spec update required, as I think the desired behavior is already covered by auto-default-structs.md:
Fixes #63018
Relates to test plan #59194