-
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
Readonly members prototype cleanup #34468
Readonly members prototype cleanup #34468
Conversation
// Equals(null); | ||
Diagnostic(ErrorCode.WRN_ImplicitCopyInReadOnlyMember, "Equals").WithArguments("Equals", "this").WithLocation(14, 9)); | ||
|
||
verifier.VerifyIL("S1.M", @" |
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.
VerifyIL [](start = 21, length = 8)
nit: consider adding a comment to point out the important thing you're trying to verify in the IL #Closed
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.
Will do. Will also split this test into two and migrate one more base method test over from ReadOnlyStructsTests. Should help with readability.
In reply to: 270201319 [](ancestors = 270201319)
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.
nit: I'm not sure the split between two test files helps (whenever a test moves, the review becomes more confusing).
In reply to: 270204398 [](ancestors = 270204398,270201319)
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.
Ah, do you think I should just leave it in its original file even though it's now verifying IL? I'm fine with that. #Closed
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.
Done with review pass (iteration 9)
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 Thanks (iteration 12)
Test plan review has revealed a few more minor changes that should be done before the feature is merged, but I am going to do them in another PR for reviewability's sake. |
@dotnet/roslyn-compiler could I get a second review please? |
Related to #32911
This PR has several minor fixes and adds coverage for some new scenarios.
ThisParameterSymbol.RefKind
API to use RefKind.In when containingMethod.IsEffectivelyReadOnlyreadonly partial
methods: both signatures must containreadonly
. Is this what we want?The last few items might need to be hashed out in review and the speclet should probably be updated to be clear about the expected behavior. (done)