Commit 87c97e7
committed
Relax assertion in TyperState#commit If there's nothing to commit
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 #14907.1 parent a51380c commit 87c97e7
File tree
2 files changed
+22
-8
lines changed- compiler/src/dotty/tools/dotc/core
- tests/pos
2 files changed
+22
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | 144 | | |
147 | 145 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments