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 MT separate compilation bug #18398

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Conversation

dwijnand
Copy link
Member

No description provided.

@dwijnand dwijnand linked an issue Aug 14, 2023 that may be closed by this pull request
@dwijnand dwijnand marked this pull request as ready for review August 14, 2023 20:29
@dwijnand dwijnand requested a review from odersky August 14, 2023 20:30
@dwijnand
Copy link
Member Author

@odersky There's a few things that go wrong to cause this:

  1. Unpickler doesn't call simplified/overrideType like Typer does, so trees have different types if they're jointly compiled or separately compiled
  2. Type simplification replaces type parameters with a type var for that type parameter in the constraint
  3. Match type reduction uses type simplify on the reduction

I went for the narrow fix, but I'm open to addressing bigger issues. What do you think we should do?

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.

It looks OK to me as far as I can tell, but I am really out of my depth here. I propose to add @sjrd as a reviewer of match type issues; he has far more up-to-date knowledge of the issues than I do.

@odersky odersky removed their assignment Aug 21, 2023
@odersky odersky requested a review from sjrd August 21, 2023 13:01
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

LGTM. Also I checked that it has the same effect if rebased on the new match types branch (i.e., the new test fails without the fix and succeeds with it).

@sjrd sjrd merged commit 6e370a9 into scala:main Aug 21, 2023
17 checks passed
@dwijnand dwijnand deleted the mt-separate-compilation-bug branch August 22, 2023 20:27
@soronpo
Copy link
Contributor

soronpo commented Aug 23, 2023

Unfortunately, continuing the "short blanket" phenomenon, this PR apparently causes a new regression #18448 (although I'm not sure this code was supposed to compile to begin with).

@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.

Multi-module match type regression in 3.3.2
5 participants