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 regression in exhaustivity of HK types #18303

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Jul 27, 2023

Reverts a key part of #16958, which is a complicated case, to fix the regression(s).

@dwijnand dwijnand linked an issue Aug 1, 2023 that may be closed by this pull request
@dwijnand dwijnand marked this pull request as ready for review August 2, 2023 08:38
@dwijnand dwijnand requested a review from SethTisue August 2, 2023 08:38
@dwijnand dwijnand added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Aug 4, 2023
Copy link
Member

@SethTisue SethTisue left a comment

Choose a reason for hiding this comment

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

Dale and I discussed this over Zoom yesterday and today. The story has grown a bit long and complicated (original ticket, original PR, regression ticket, this PR) and there are multiple overlapping concerns (which is why a partial reversion is even an option).

I'm satisfied that this PR should be merged, since (to make a long story short) 1) it fixes the regression, 2) it's only reverting code that was added only quite recently anyway. So this seems mergeable and desirable to me, even if it's not necessairily the final chapter in this story.

So I'm hitting approve, but let's summon @liufengyun. Fengyun, you approved the original PR, do you want to take a look at this one as well?

@Kordyjan note the backport-nominated label here. This partially reverts a PR that was merged for 3.3.1, so it should at least be considered for 3.3.2 IMO.

@dwijnand dwijnand assigned liufengyun and unassigned SethTisue Aug 4, 2023
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

Should #16451 be re-opened?

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala Outdated Show resolved Hide resolved
@@ -4,5 +4,7 @@ case class Fun[A, B](f: Exp[A => B]) extends Exp[A => B]
class Test {
def eval(e: Fun[Int, Int]) = e match {
case Fun(x: Fun[Int, Double]) => ??? // error
case Fun(x: Exp[Int => String]) => ??? // error
case _ =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why the 2nd case was removed before, restoring it seems to be more reasonable. Otherwise, it seems not easy to justify why the 1st case receives a warning.

Copy link
Member Author

Choose a reason for hiding this comment

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

The warning on the first one became (and now revert away from) an unchecked warning, on the unchecked type test.

The motivating case (i16451) is complicated, because it involves
unchecked type arguments.  To fix the regression, I'm reverting the fix.
@dwijnand
Copy link
Member Author

dwijnand commented Aug 8, 2023

Should #16451 be re-opened?

As issues are assigned to release milestone, I'd rather just open a new issue - which I'll do after merging.

@dwijnand dwijnand merged commit 512fbd5 into scala:main Aug 8, 2023
17 checks passed
@dwijnand dwijnand deleted the space-engine-aux-hk branch August 8, 2023 17:14
@SethTisue SethTisue changed the title Fix regression in exhausitivity of HK types Fix regression in exhaustivity of HK types Aug 9, 2023
Kordyjan added a commit that referenced this pull request Aug 10, 2023
@soronpo
Copy link
Contributor

soronpo commented Sep 3, 2023

There is still a regression in 3.3.1-RC7 after this was backported: #18507

@Kordyjan Kordyjan removed the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Oct 10, 2023
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 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.

Regression in match exhaustivity of higher-kinded types
5 participants