Skip to content
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

Conversation

RikkiGibson
Copy link
Contributor

@RikkiGibson RikkiGibson commented Mar 26, 2019

Related to #32911

This PR has several minor fixes and adds coverage for some new scenarios.

  • Addresses and removes prototype comments (except for the public API ones in Add IMethodSymbol.IsReadOnly to public API #34514)
  • Updates ThisParameterSymbol.RefKind API to use RefKind.In when containingMethod.IsEffectivelyReadOnly
  • Updates compiler test plan to mention readonly members
  • Tests codegen of ReadOnlyMethod_OverrideBaseMethod
  • Tests readonly partial methods: both signatures must contain readonly. Is this what we want?
    • Resolution: either both signatures or neither signature must contain 'readonly'.
  • Tests readonly explicit interface implementations. These are allowed. Do we want that?
    • Resolution: 'readonly' explicit interface implementations are allowed.

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)

@RikkiGibson RikkiGibson marked this pull request as ready for review March 28, 2019 19:28
@RikkiGibson RikkiGibson requested a review from a team as a code owner March 28, 2019 19:28
@RikkiGibson RikkiGibson added this to the 16.1.P2 milestone Mar 28, 2019
// Equals(null);
Diagnostic(ErrorCode.WRN_ImplicitCopyInReadOnlyMember, "Equals").WithArguments("Equals", "this").WithLocation(14, 9));

verifier.VerifyIL("S1.M", @"
Copy link
Member

@jcouv jcouv Mar 28, 2019

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

Copy link
Contributor Author

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)

Copy link
Member

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)

Copy link
Contributor Author

@RikkiGibson RikkiGibson Mar 28, 2019

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

Copy link
Member

@jcouv jcouv left a 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)

@jcouv jcouv self-assigned this Mar 28, 2019
Copy link
Member

@jcouv jcouv left a 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)

@RikkiGibson
Copy link
Contributor Author

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.

@RikkiGibson
Copy link
Contributor Author

@dotnet/roslyn-compiler could I get a second review please?

@RikkiGibson RikkiGibson merged commit 56214c6 into dotnet:features/readonly-members Mar 29, 2019
@RikkiGibson RikkiGibson deleted the readonly-members-prototype-cleanup branch March 29, 2019 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants