Skip to content

fix #11764: generic sums can have no children #15010

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

Closed
wants to merge 1 commit into from

Conversation

bishabosha
Copy link
Member

closes #11764

enable generic sum types to have no children, while also asserting that it is not a sealed abstract case class.

@bishabosha
Copy link
Member Author

bishabosha commented Apr 25, 2022

so, it seems that in the community build ProtoQuill (List.reduce in coproducts analysis) and play-json ("Json.reads[EmptyFamily]".mustNot(typeCheck)) assume that there will be at least one child if you have a mirror

@dwijnand dwijnand assigned bishabosha and unassigned dwijnand Apr 28, 2022
@bishabosha bishabosha added the needs-minor-release This PR cannot be merged until the next minor release label Apr 29, 2022
@bishabosha bishabosha added this to the 3.2.0-RC1 milestone Apr 29, 2022
@bishabosha
Copy link
Member Author

bishabosha commented Apr 29, 2022

so because apparently libraries have been build upon the assumption that sum types do have at least one child, then I guess this should only go in a minor release, if at all. One would have to make the case that the status quo is more inconvenient. @japgolly what do you think?

One solution that could be less disruptive is to introduce another subclass of Mirror for sum types with zero children

@bishabosha
Copy link
Member Author

we decided its not worth the pain with the libraries already working on the assumption that a Sum has minimum 1 child.

@bishabosha bishabosha closed this May 4, 2022
@dwijnand dwijnand removed this from the 3.2.0-RC1 milestone May 30, 2022
@bishabosha bishabosha deleted the fix-11764 branch May 8, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-minor-release This PR cannot be merged until the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mirror.SumOf not being provided when 0 inhabitants
3 participants