Commit 408298d
authored
Handle assertion error in TyperState (#23665)
#23609 triggers an assertion error in TyperState. The relevant
explanation seems to be in ProtoTypes.scala:
```scala
// To respect the pre-condition of `mergeConstraintWith` and keep
// `protoTyperState` committable we must ensure that it does not
// contain any type variable which don't already exist in the passed
// TyperState. This is achieved by instantiating any such type
// variable. NOTE: this does not suffice to discard type variables
// in ancestors of `protoTyperState`, if this situation ever
// comes up, an assertion in TyperState will trigger and this code
// will need to be generalized.
```
We should go to the bottom of it and fix the assertion. But before
that's done this PR offers a temporary hack to catch the exception when
it is triggered from a new code path created by PR #23532. This should
fix the regression reported in #23609. We should leave the issue open as
a reminder that we still need a better fix.
Also: handle crash due to missing span in a migration helper.1 parent a9c214f commit 408298d
File tree
3 files changed
+19
-5
lines changed- compiler/src/dotty/tools/dotc
- core
- typer
3 files changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
272 | | - | |
273 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
274 | 278 | | |
275 | 279 | | |
276 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4368 | 4368 | | |
4369 | 4369 | | |
4370 | 4370 | | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
| 4378 | + | |
| 4379 | + | |
4371 | 4380 | | |
4372 | 4381 | | |
4373 | 4382 | | |
4374 | | - | |
4375 | | - | |
| 4383 | + | |
| 4384 | + | |
4376 | 4385 | | |
4377 | 4386 | | |
4378 | 4387 | | |
| |||
0 commit comments