-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Assertion failed: Attempt to commit TS[...] into already committed TS[...] #14907
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
Comments
Can't reproduce on either 3.1.1 or 3.1.3-RC1-bin-20220410-220b753-NIGHTLY, did you minimize too much? |
I can reproduce on Scastie and GitHub Actions. See the Actions output: FlorianCassayre/dotty-i14907 |
Ah thanks, to reproduce when using the compiler directly requires adding the flag |
Good to know, thanks for the precisions, I'll keep that in mind for the next time. |
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.
With the latest nightly, I'm now getting a different assertion error (from a piece of code containing a similar snippet). I'll try to produce a minimization. |
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.
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.1.3-RC1-bin-20220410-220b753-NIGHTLY
down to3.0.1
using-Yforce-sbt-phases
Minimized code
Output (click arrow to expand)
The compiler outputs additional stuff to the standard output.
This code compiles on
3.0.0
, but not on3.0.1
and later.The text was updated successfully, but these errors were encountered: