Skip to content

Fix type inferencing (constraining) regressions #19189

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

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Dec 4, 2023

No description provided.

@dwijnand
Copy link
Member Author

dwijnand commented Dec 7, 2023

I feel so torn about this. On the one hand I think it's sad that ?X & ?Y <:< A & (B & C) infers differently than ?X & ?Y <:< (A & B) & C as of this change. On the other hand I think it's good that same structured types are traversed and types are inferred from that, i.e. B & Foo <:< ?A & Foo constrains ?A >: B instead of ?A >: B & Foo.

The problem in ZIO is that ZIO's ZLayer uses with. And with associates to the right, while & associates to the left. So they programmatically build up (A with B) with C but A with B with C is actually A with (B with C). Everything works correctly with &, so I changed the source definitions.

@dwijnand dwijnand changed the title Refix constraining two intersections Fix type inferencing (constraining) regressions Dec 11, 2023
@dwijnand dwijnand marked this pull request as ready for review December 12, 2023 12:41
@dwijnand dwijnand assigned WojciechMazur and unassigned dwijnand Dec 12, 2023
Copy link
Contributor

@WojciechMazur WojciechMazur left a comment

Choose a reason for hiding this comment

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

Looks good to me. I've also run the Open CB against this PR and it confirms fix all linked regressions and does not introduce any new ones.

@dwijnand dwijnand merged commit 97f3799 into scala:main Dec 13, 2023
@dwijnand dwijnand deleted the infer branch December 13, 2023 10:00
@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 asflierl/sglicko2 - type inference Regression in apache/incubator-pekko - invalid type inference
3 participants