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

fix #15222 recursively check for product ctor accessibility #15231

Merged
merged 3 commits into from
May 27, 2022

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented May 19, 2022

mostly a refactoring, except now whyNotGenericSum will benefit by checking the constructor accessibility of child product types.

Removes the declScope parameter from whyNotGenericSum because it is not useful. In all cases it is populated by either the companion object of self when it is valid to use as the mirror, or it is the context owner when we should use an anonymous mirror. This is awkward because we end up calling useCompanionAsSumMirror twice in each recursive call.

Also fixes an inconsistency where scala.Nil.type would not get a singleton mirror, causing a runtime error (and extends it to aliases of singleton enum values)

fixes #15222
fixes #15234

@bishabosha bishabosha added this to the 3.2.0-RC1 milestone May 19, 2022
@bishabosha bishabosha requested a review from nicolasstucki May 19, 2022 09:38
@bishabosha bishabosha changed the title recursively check for product ctor accessibility fix #15222 recursively check for product ctor accessibility May 19, 2022
@bishabosha bishabosha requested review from dwijnand and removed request for nicolasstucki May 20, 2022 08:10
@bishabosha bishabosha assigned dwijnand and unassigned nicolasstucki May 20, 2022
@bishabosha bishabosha requested a review from odersky May 20, 2022 08:12
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@odersky odersky assigned bishabosha and unassigned odersky May 26, 2022
@bishabosha bishabosha merged commit 001bfc3 into scala:main May 27, 2022
@bishabosha bishabosha deleted the fix-15222 branch May 27, 2022 09:57
@Kordyjan Kordyjan modified the milestones: 3.2.0-RC1, 3.2.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants