Commit 7387da3
committed
Preserve tvar bounds that represent kinds
The kinds of type variables being solved are represented by by their
upper bounds. If we loose track of these then kinds will be incorrect on
the RHS of inline matches and match types.
Without the additional change in TypeComparer this breaks
tests/pos/i5574.scala. The added fallback to fourthTry brings the higher
kinded case into line with the path that's followed in the simply kinded
case and restores the correct behaviour. Unfortunately I'm not able to
justify it other than that it emerged from extensive trial and error and
comparison with the simply kinded case.
I'd also love to understand the use return in TypeComparer. Is it an
optimization or does it have some semantic significance?
Fixes #6014.1 parent 8ecc927 commit 7387da3
File tree
4 files changed
+31
-2
lines changed- compiler
- src/dotty/tools/dotc/core
- test/dotc
- tests/pos
4 files changed
+31
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
932 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
933 | 936 | | |
934 | 937 | | |
935 | 938 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 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