Commit e56b75e
committed
Handle TupleXXL in match analysis
There's a number of problems with the match analysis of TupleXXL.
Of course, they manifest as (in)exhaustivity and (un)reachability
warnings.
Reachability suffered by the problem that a large generic tuple
scrutinee type wasn't considered extractable by the TupleXXL extractor
that Typer associates the extractor pattern with. That was solved by
special handling in SpaceEngine's isSubType.
Exhaustivity suffered by a variety of problems, again stemming from the
disconnect between the TupleXXL pattern type and the large generic tuple
scrutinee (or component) type. That was solved by special handling in
exhaustivityCheckable to ignore large generic tuple scrutinees.
That then highlighted an irrefutable failure (checkIrrefutable), which
also needed to be taught that extra large generic tuples do conform to
TupleXXL extractors type, afterwhich SpaceEngine isIrrefutable needed
special handling to consider TuplXXL irrefutable.1 parent d96e9e4 commit e56b75e
File tree
7 files changed
+97
-15
lines changed- compiler/src/dotty/tools/dotc
- core
- transform/patmat
- typer
- tests/pos
7 files changed
+97
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 75 | + | |
| 76 | + | |
81 | 77 | | |
82 | 78 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 290 | + | |
294 | 291 | | |
| 292 | + | |
295 | 293 | | |
296 | 294 | | |
297 | 295 | | |
| |||
505 | 503 | | |
506 | 504 | | |
507 | 505 | | |
| 506 | + | |
508 | 507 | | |
509 | 508 | | |
510 | 509 | | |
| |||
836 | 835 | | |
837 | 836 | | |
838 | 837 | | |
839 | | - | |
| 838 | + | |
840 | 839 | | |
841 | 840 | | |
842 | 841 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
939 | | - | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
940 | 943 | | |
941 | 944 | | |
942 | 945 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments