Commit 1ea4c86
committed
Heal occurrences of => T between ElimByName and Erasure
There's a window of vulnerability between ElimByName and Erasure where some
ExprTypes `=> T` that appear as parameters of function types are not yet converted
to by-name functions `() ?=> T`. These would cause an assertion violation when
used as operands of & or |. We fix this on the fly when forming these types in TypeComparer.
As explained in ElimByName, we can't fix it beforehand by mapping all occurrences of `=> T` to
`() ?=> T` since that could lead to cycles.
Fixes #195481 parent 1716bcd commit 1ea4c86
File tree
2 files changed
+17
-2
lines changed- compiler/src/dotty/tools/dotc/core
- tests/pos
2 files changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2508 | 2508 | | |
2509 | 2509 | | |
2510 | 2510 | | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
2511 | 2524 | | |
2512 | 2525 | | |
2513 | 2526 | | |
| |||
2516 | 2529 | | |
2517 | 2530 | | |
2518 | 2531 | | |
2519 | | - | |
| 2532 | + | |
2520 | 2533 | | |
2521 | 2534 | | |
2522 | 2535 | | |
| |||
2561 | 2574 | | |
2562 | 2575 | | |
2563 | 2576 | | |
2564 | | - | |
| 2577 | + | |
2565 | 2578 | | |
2566 | 2579 | | |
2567 | 2580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments