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 #13455: Also consider sealed classes closed sums #13483

Merged
merged 5 commits into from
Sep 23, 2021

Conversation

OlivierBlanvillain
Copy link
Contributor

No description provided.

The warnings on master are incorrect: we know that no instance of SealedClass match the corresponding cases.
@OlivierBlanvillain OlivierBlanvillain marked this pull request as ready for review September 7, 2021 14:39
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

After commenting in #13455, I'm more certain that you can't change this and not change the children side too, though I don't have the concrete counter-example to prove it.

This commit renames isClosedSum to isDecomposable, and moves that
function and the decompose function to where they are used locally.
The logic in question only makes sense at the precise point where it's
used (see the added comment), so having those two functions defined
locally helps to avoid confusion.
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

A small typo (iiuc) but looks good to me now, thanks for the attention, @OlivierBlanvillain!

compiler/src/dotty/tools/dotc/core/TypeComparer.scala Outdated Show resolved Hide resolved
@OlivierBlanvillain OlivierBlanvillain merged commit abc11ac into scala:master Sep 23, 2021
@OlivierBlanvillain OlivierBlanvillain deleted the fix-13455 branch September 23, 2021 17:38
@dwijnand
Copy link
Member

Even better. 💯

@Kordyjan Kordyjan added this to the 3.1.1 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.

4 participants