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

Force consistent MT post-redux normalisation, disallow infinite match types #18073

Merged
merged 4 commits into from
Jul 3, 2023

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Jun 27, 2023

Fixes #16596

@dwijnand dwijnand marked this pull request as ready for review June 27, 2023 12:05
@johnynek
Copy link

Thank you for working on this.

Personally, I think trading unbounded recursion in match types for match types composing with implicit/given resolution is a trade I would always make.

If you really want an infinite recursion in the types, you could still do so with a class or trait.

@dwijnand dwijnand changed the title Force MT reduction simplification, disallow infinite match types Force consistent MT post-redux normalisation, disallow infinite match types Jul 1, 2023
I gave match type's redux an extension to the normalize algorithm, in
order to make the test suite pass, as well as add an extra recursion to
the simplify algorithm.  A few neg tests tweaked and some other code
changes could be dropped.
@dwijnand
Copy link
Member Author

dwijnand commented Jul 2, 2023

Ugh, now this is failing against the perspective community project, needing the fix in #18043...

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.

After discussions I now see that the rejections infinite match types are fine.

I propose to change normalized back to simplified and merge the PR like that.

@dwijnand dwijnand merged commit 108f8d0 into scala:main Jul 3, 2023
@dwijnand dwijnand deleted the mt/recur-cases branch July 3, 2023 20:34
@soronpo
Copy link
Contributor

soronpo commented Jul 21, 2023

This PR also caused the regression: #18261

@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 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.

Recursive match type fails after 3rd call when using explicit type
5 participants