Commit 311e5ce
committed
Fix multiversal equality checks for pattern matching
Equality checks against constants in patterns were usually suppressed since they were only issued if
the GADT constrainer return false. We now drop this as a condition.
This uncovered a missing position error, where we did a resolveOverloading when unpickling some
Scala 2 code in Pattern mode. The missing position was the tree in the equality check, which
is not surprising since was an annotation argument. The fix here was to make sure that we do
overloading resolution only in expression mode.1 parent b22331e commit 311e5ce
File tree
3 files changed
+33
-8
lines changed- compiler/src/dotty/tools/dotc
- ast
- typer
- tests/neg
3 files changed
+33
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1594 | 1594 | | |
1595 | 1595 | | |
1596 | 1596 | | |
1597 | | - | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
1598 | 1600 | | |
1599 | 1601 | | |
1600 | 1602 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3608 | 3608 | | |
3609 | 3609 | | |
3610 | 3610 | | |
3611 | | - | |
| 3611 | + | |
3612 | 3612 | | |
3613 | | - | |
3614 | | - | |
3615 | | - | |
3616 | | - | |
3617 | | - | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
3618 | 3617 | | |
3619 | 3618 | | |
3620 | 3619 | | |
3621 | 3620 | | |
3622 | 3621 | | |
3623 | 3622 | | |
3624 | | - | |
3625 | 3623 | | |
3626 | 3624 | | |
3627 | 3625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments