-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Release/5.0] Fix covariant returns when overriding method of non-parent ancestor #47937
[Release/5.0] Fix covariant returns when overriding method of non-parent ancestor #47937
Conversation
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.
Approved. Please get a cr and I will take it for consideration.
@janvorli can you address the merge conflicts here ? |
Sure, I'll resolve it in a minute. |
…ent ancestor There is a problem in the ClassLoader::ValidateMethodsWithCovariantReturnTypes that results in failed verification of valid override in case the return type of the method being overriden is generic in canonical form and it is defined in an ancestor class that is not the parent. The problem is that we attempt to use instantiation of the parent class instead of the ancestor class that contains definition of the method being overriden. This change fixes it by locating the proper ancestor MethodTable and using it.
7384f76
to
43a8b88
Compare
@Anipik done |
It looks like brew installation of dependencies is broken on OSX / iOS / tvOS: |
Port #47846 to release/5.0
There is a problem in the
ClassLoader::ValidateMethodsWithCovariantReturnTypes that results in
failed verification of valid override in case the return type of the
method being overriden is generic in canonical form and it is defined
in an ancestor class that is not the parent.
The problem is that we attempt to use instantiation of the parent class
instead of the ancestor class that contains definition of the method
being overriden.
This change fixes it by locating the proper ancestor MethodTable and
using it.
Customer Impact
Valid application that uses multiple generic type arguments in covariant return override where some of them but not all are canonical crashes at runtime with System.TypeLoadException when attempting to use the underlying type.
Testing
CoreCLR pri1 tests, including the new test added that specifically target the problematic cases (copy of the repro provided by our customer that have found the issue)
Risk
Low
Regression
No