Consider optimizing constrained calls to base methods on readonly struct in some cases #66365
Labels
Area-Compilers
Code Gen Quality
Room for improvement in the quality of the compiler's generated code
Milestone
Follow-up issue on comment #66189 (comment)
In the following test, we could avoid copying the instance of
S1
as receiver for constrained call toobject.ToString()
.Aleksey's proposal: Perhaps we could optimize cases like this as long as consumer and the consumed type are in the same module.
If we can avoid this copy, we would instead have the following IL (like before):
Relates to PR #66189 which fixed some correctness issues with such constrained calls.
The text was updated successfully, but these errors were encountered: