Skip to content

Fix check for unimplemented members in a concrete class #11439

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

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

smarter
Copy link
Member

@smarter smarter commented Feb 17, 2021

Before this commit, this check was done using Type#matchesLoosely, which
behaves differently from Denotation#matchesLoosely, in particular the
latter requires matching signatures and the former does not, and because
bridge generation at Erasure relies on denotation matching, we could end
up with unimplemented members at runtime. Fixed by switching to
denotation matching which should now be used uniformly everywhere we
check for overrides.

This commit also improves the error message of this check to list where
the abstract member and non-matching concrete members come from, since
this can be difficult to figure out in a complex hierarchy.

Fixes #10666.

@smarter smarter force-pushed the override-fix-2 branch 2 times, most recently from 30f68d6 to 1922ff6 Compare February 17, 2021 15:21
@smarter smarter requested a review from odersky February 17, 2021 15:32
odersky
odersky previously approved these changes Feb 23, 2021
Before this commit, this check was done using Type#matchesLoosely, which
behaves differently from Denotation#matchesLoosely, in particular the
latter requires matching signatures and the former does not, and because
bridge generation at Erasure relies on denotation matching, we could end
up with unimplemented members at runtime. Fixed by switching to
denotation matching which should now be used uniformly everywhere we
check for overrides.

This commit also improves the error message of this check to list where
the abstract member and non-matching concrete members come from, since
this can be difficult to figure out in a complex hierarchy.

Fixes scala#10666.
This was already fixed by scala#11361.
@smarter smarter merged commit 7920e70 into scala:master Feb 23, 2021
@smarter smarter deleted the override-fix-2 branch February 23, 2021 20:15
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants