Commit b0a3ed0
committed
Fix #8404: Use both scrutinee type and given type in pattern ascriptions
In a pattern ascription `x: T` type `x` to have the intersection of
the given type `T` and the scrutinee type. This matches scalac's behavior.
It now makes i5418.scala compile. The type intersection was enough to make
that one compile, it did not need unsound covariant GADT matching (which was
what I claimed before in the issue).1 parent c6b681c commit b0a3ed0
File tree
7 files changed
+25
-3
lines changed- compiler
- src/dotty/tools/dotc/typer
- test/dotty/tools/dotc
- tests
- pos
- run-deep-subtype
- colltest4
7 files changed
+25
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1573 | 1573 | | |
1574 | 1574 | | |
1575 | 1575 | | |
1576 | | - | |
1577 | | - | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1578 | 1590 | | |
1579 | 1591 | | |
1580 | 1592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
0 commit comments