-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
sum mirror is available when mirror for child can't be summoned #15222
Comments
because of this bug, object Foo will unnecessarily extend |
this example is quite problematic - from within So what to do?
|
Why does the child also need to have a mirror? |
A class is only a "generic sum" if all of its children are also either "generic sum" or "generic product". That has been the rule forever, so we should be quite careful to consider this recursive case whenever we change the rules for mirror generation |
Hmm I didn't know that - what is the reason for this limitation? |
mirrors are meant to represent an algebraic data type, and that all parts mentioned by the mirror should be reachable. |
fix #15222 recursively check for product ctor accessibility
The fix for #14986 does not consider when a sum type has a child for which the mirror can not be summoned.
Compiler version
3.2.0-RC1-bin-20220517-e5abec0-NIGHTLY
First bad commit d6e17a2 in #15008
Minimized code
Output
Expectation
summon[Mirror.SumOf[lib.Foo]]
should also fail because in the calling scope, the child of Foo, i.e.Bar
can not have a mirror - this affects signatures of Foo, because object Foo should not cache the mirror.The text was updated successfully, but these errors were encountered: