Commit 85672a0
authored
Fix match type extraction of a MatchAlias (#20111)
Previously this failed with:
```
14 | val x: Base.ExtractValue[Sub[Int *: EmptyTuple]] = 1
| ^
| Found: (1 : Int)
| Required: Base.ExtractValue[Sub[Int *: EmptyTuple]]
|
| Note: a match type could not be fully reduced:
|
| trying to reduce Base.ExtractValue[Sub[Int *: EmptyTuple]]
| failed since selector Sub[Int *: EmptyTuple]
| does not uniquely determine parameter v in
| case Base.BaseOf[v] => v
| The computed bounds for the parameter are:
| v = Tuple.Head[Int *: EmptyTuple]
```
Because the match type logic incorrectly believed that `v` was a
non-alias TypeBounds.File tree
2 files changed
+12
-1
lines changed- compiler/src/dotty/tools/dotc/core
- tests/pos
2 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3518 | 3518 | | |
3519 | 3519 | | |
3520 | 3520 | | |
3521 | | - | |
| 3521 | + | |
3522 | 3522 | | |
3523 | 3523 | | |
3524 | 3524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments