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

simplify: Drop mapping tparams to tvars #18786

Closed

Conversation

dwijnand
Copy link
Member

Mapping type params back to type vars is dangerous for match types
because it can lead to one use-site's type var being cached as the
reduction of the match type in a match alias defintion.

It looks like mapping type parameters to type vars is only important
when getting the instance type of a type parameter, because the bounds
could make references to other parameters, including as type arguments.
So, as long as we map then, we can drop this mapping from general
simplification.

There is, however, something going on with capture checking, which I
documented, but perhaps it's due to some underlying bug. The situation
occurs because boxed A *: T does seem to match case x *: _. So I kept
the fully-defined forcing and normalization case from simplify.

Mapping type params back to type vars is dangerous for match types
because it can lead to one use-site's type var being cached as the
reduction of the match type in a match alias defintion.

It looks like mapping type parameters to type vars is only important
when getting the instance type of a type parameter, because the bounds
could make references to other parameters, including as type arguments.
So, as long as we map then, we can drop this mapping from general
simplification.

There is, however, something going on with capture checking, which I
documented, but perhaps it's due to some underlying bug.  The situation
occurs because boxed A *: T does seem to match case x *: _.  So I kept
the fully-defined forcing and normalization case from simplify.
@dwijnand dwijnand linked an issue Oct 29, 2023 that may be closed by this pull request
@soronpo
Copy link
Contributor

soronpo commented Dec 18, 2023

3.3.2-RC1 is already underway, yet this regression is left open. What concerns me most is that the compiler is undergoing drastic changes which could cause more regressions, but we have no way of knowing before first solving the known regressions and bringing the OpenCB to a green status.

@soronpo
Copy link
Contributor

soronpo commented Dec 19, 2023

I tested the issue on 3.3.2-RC1 and it seems to be resolved. Was the original change reverted or did something else resolve the bug?

@dwijnand
Copy link
Member Author

I assume by your comment (#18171 (comment)) that it's still reverted.

@soronpo
Copy link
Contributor

soronpo commented Dec 19, 2023

I assume by your comment (#18171 (comment)) that it's still reverted.

It was a different PR that caused the regression, IIUC.

@soronpo
Copy link
Contributor

soronpo commented Dec 19, 2023

In any case, I now tested under the latest 3.4 nightly 3.4.0-RC1-bin-20231207-16f1680-NIGHTLY and the bug still exists. Oh well...
I was too optimistic for a moment there. At least 3.3.2 is good for now.

@dwijnand dwijnand closed this Feb 19, 2024
@dwijnand dwijnand deleted the mt/drop-tparam-to-tvar-in-simplify branch February 19, 2024 15:16
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
2 participants