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

Properly handle self-types in reflection member lookup #12893

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 21, 2021

The type on which we lookup things needs to be the this-type of the
class, otherwise it will not include members that only appear in the
self-type, since these members can appear in the types of members of the
current class, this could lead to a MissingType exception being thrown.

Fixes #12081.

PS: as the documentation of allMembers mention, it's an expensive method to call and it would be better to call memberDenots with a custom filter, but that's a bigger refactoring than I have time to tackle right now.

The type on which we lookup things needs to be the this-type of the
class, otherwise it will not include members that only appear in the
self-type, since these members can appear in the types of members of the
current class, this could lead to a MissingType exception being thrown.

Fixes scala#12081.
@nicolasstucki nicolasstucki merged commit ff044e0 into scala:master Jul 2, 2021
@nicolasstucki nicolasstucki deleted the fix-reflect-members branch July 2, 2021 05:36
@Kordyjan Kordyjan added this to the 3.0.2 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
Development

Successfully merging this pull request may close these issues.

Stack traces and error messages in compiler output when using scaladoc
3 participants