Skip to content

Fix regression in cyclic constraint handling #16514

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 14, 2022

Conversation

smarter
Copy link
Member

@smarter smarter commented Dec 13, 2022

This regressed in 50eb0e9 when current.ensureNonCyclic was incorrectly replaced by validBoundsFor which operates on this, not current.

This isn't the first time we make this error (cf
a8641c5), maybe we should refactor OrderingConstraint so that operations on current are done in the companion object where this isn't accessible.

Fixes #16471. Note that the test case from this issue couldn't be added because it fails -Ycheck:typer, but this was also the case before the regression. This is now tracked by #16524.

@smarter
Copy link
Member Author

smarter commented Dec 13, 2022

The CI fails because the test case fails -Ycheck:typer, but it was already broken like that in previous releases. I'll investigate and/or find a simpler test case.

@smarter smarter assigned smarter and unassigned odersky Dec 13, 2022
@odersky
Copy link
Contributor

odersky commented Dec 14, 2022

This isn't the first time we make this error (cf
a8641c5), maybe we should refactor OrderingConstraint so that operations on current are done in the companion object where this isn't accessible.

I agree, this would make it safer.

This regressed in 50eb0e9 when
`current.ensureNonCyclic` was incorrectly replaced by `validBoundsFor` which
operates on `this`, not `current`.

This isn't the first time we make this error (cf
a8641c5), maybe we should refactor
OrderingConstraint so that operations on `current` are done in the companion
object where `this` isn't accessible.

Fixes scala#16471. Note that the test case from this issue couldn't be added
because it fails `-Ycheck:typer`, but this was also the case before the
regression. This is now tracked by scala#16524.
@smarter
Copy link
Member Author

smarter commented Dec 14, 2022

I've replaced the test case by a unit test and opened #16524 to keep track of the Ycheck failure.

@smarter smarter assigned odersky and unassigned smarter Dec 14, 2022
@odersky odersky enabled auto-merge December 14, 2022 18:14
@odersky odersky merged commit 1e6a747 into scala:main Dec 14, 2022
@odersky odersky deleted the fix-validBoundsFor branch December 14, 2022 18:30
@Kordyjan Kordyjan added this to the 3.3.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.

Regression in type inference - critical for sangria-graphl ecosystem
3 participants