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

[mono][metadata] Fix lookup of matching interface method with covariant returns #84160

Merged
merged 2 commits into from
Apr 20, 2023

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Mar 31, 2023

When a class is implementing an interface, we lookup up a matching method (with exact signature) in the class methods and inherited virtual methods. This doesn't handle the situation where the interface was matching a virtual method declared in one of the parents, which was then overriden with a covariant return method. If that is the case, the covariant return method is considered as the implementation of the interface method.

Fixes #78635

@BrzVlad
Copy link
Member Author

BrzVlad commented Mar 31, 2023

TODO add tests

…nt returns

When a class is implementing an interface, we lookup up a matching method (with exact signature) in the class methods and inherited virtual methods. This doesn't handle the situation where the interface was matching a virtual method declared in one of the parents, which was then overriden with a covariant return method. If that is the case, the covariant return method is considered as the implementation of the interface method.
@BrzVlad BrzVlad merged commit 7222061 into dotnet:main Apr 20, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeLoadException in WASM with Covariance
2 participants