Skip to content

Relax assertion in TyperState#commit If there's nothing to commit; clear unreported warnings in Reporter#flush #15037

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 2 commits into from
May 2, 2022

Conversation

smarter
Copy link
Member

@smarter smarter commented Apr 26, 2022

No description provided.

smarter added 2 commits April 26, 2022 15:00
If the added test case is run with `-Yforce-sbt-phases`, a LazyRef (created in
the LazyRef case of TypeMap#mapOver) captures a Context. Later, that LazyRef is
forced, but at that point the TyperState of the captured Context is already
committed, so we're not allowed to commit anything in it anymore. But forcing
the LazyRef ends up calling `isFullyDefined` which unconditionally creates a
temporary TyperState and commit it, thus triggering the assertion.

We fix this by relaxing the assertion to allow committing into a TyperState if
there's nothing to commit. This should handle all LazyRefs since they never wrap
uninstantiated type variables in practice.

Fixes scala#14907.
@smarter smarter requested a review from odersky April 26, 2022 15:12
@odersky odersky merged commit 0e83a80 into scala:main May 2, 2022
@odersky odersky deleted the exp-i14907 branch May 2, 2022 17:36
@Kordyjan Kordyjan added this to the 3.2.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.

3 participants