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

Ensure lvalue struct receivers are not copied by value by implicit Range indexer rewrite #65805

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

AlekseyTs
Copy link
Contributor

Fixes #65586.
Related to #63221.

@AlekseyTs AlekseyTs requested a review from a team as a code owner December 6, 2022 15:14
@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler Please review

@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler For the second review.

1 similar comment
@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler For the second review.

@AlekseyTs AlekseyTs changed the title Ensure lvalue struct receivers are not copied by value implicit Range indexer rewrite Ensure lvalue struct receivers are not copied by value by implicit Range indexer rewrite Dec 8, 2022
@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler For the second review.

IL_0026: pop
IL_0027: ret
}
");
Copy link
Member

@cston cston Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include VerifyIL("Shift2<T>", ...); as well here, and in GenericTypeParameterAsReceiver_ImpicitRangeIndexer_RangeExpression_Struct_Ref? #Resolved

Copy link
Contributor Author

@AlekseyTs AlekseyTs Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include VerifyIL("Shift2<T>", ...); as well here, and in ...

That method is the same as in the "Class" flavor of the test and its IL is verified there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we only need to verify its runtime behavior with an input which is a struct

@AlekseyTs AlekseyTs merged commit 4c793aa into dotnet:main Dec 8, 2022
@ghost ghost added this to the Next milestone Dec 8, 2022
@Cosifne Cosifne modified the milestones: Next, 17.5 P3 Jan 4, 2023
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.

Side effects of implicit Range indexer on a struct type are not propagated to the receiver
4 participants