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

Harden GADT constraint handling to survive illegal F-bounds #20325

Merged
merged 2 commits into from
May 7, 2024

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 2, 2024

This currently fails BestEffortCompilationTests

The problem is that i20317a.scala contains illegal cyclic references. The cycles cause many different algorithms in the compiler to loop. We normally reject the program, and that's that. But under best-effort, we crash with Stackoverflows in the loops later. What to do? It's not feasible to avoid the looping behavior at acceptable cost. Can we disable best effort under certain conditions?

@odersky odersky requested a review from jchyb May 2, 2024 15:37
@jchyb
Copy link
Contributor

jchyb commented May 3, 2024

The fix is to put the file name into compiler/test/dotc/neg-best-effort-unpickling.blacklist. This will cause this specific test to not be executed and the CI to pass, as it does with other files test files related to cyclic reference errors. In the real world IDE scenario we let it crash with the message and handle that gracefully on an IDE side (I know this is far from a perfect solution, and there are a few other yet-unsolved cases like cyclic-reference-errors).

Usually in CI we should get a message asking to put the file in compiler/test/dotc/neg-best-effort-unpickling.blacklist. but I see it does not show there now (which in hindsight, makes sense), so this is definitely something I need to fix.

In general I would not want the compiler development to be throttled by the best-effort options in any way, so using the aforementioned exclusion list is very much expected. Again, the message with the exclusion list it was supposed to show, but it makes sense it wouldn't with the stack error.

I'll figure something out for cyclic-reference errors in the coming weeks for 3.5.1. I apologize for the inconvenience!

@odersky odersky merged commit 44c1e3a into scala:main May 7, 2024
19 checks passed
@odersky odersky deleted the fix-20317 branch May 7, 2024 19:28
@hamzaremmal hamzaremmal mentioned this pull request May 8, 2024
@Kordyjan Kordyjan modified the milestone: 3.5.0 May 10, 2024
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
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.

3 participants