Commit b222e9f
committed
Fix #5422: prefer type tp1 in Typ(tp1) - Prod(tp2, ...)
In `Typ(tp1) - Prod(tp2, ...)` with `tp1 <: tp2`, we rewrite
`Typ(tp1)` to `Prod(tpx, Nil)`. We should prefer `tp1` over
`tp2`, as the latter is usually a bigger space, due to the
erasure of pattern bound symbol references during
pattern-space projection.1 parent c0941f3 commit b222e9f
File tree
2 files changed
+22
-1
lines changed- compiler/src/dotty/tools/dotc/transform/patmat
- tests/patmat
2 files changed
+22
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| |||
| 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 | + | |
0 commit comments