diff options
Diffstat (limited to 'stdlib/source/lux/compiler/default/phase/analysis/case.lux')
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/case.lux | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/stdlib/source/lux/compiler/default/phase/analysis/case.lux b/stdlib/source/lux/compiler/default/phase/analysis/case.lux index 5b5b2038c..0d3536db3 100644 --- a/stdlib/source/lux/compiler/default/phase/analysis/case.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/case.lux @@ -208,7 +208,7 @@ [nextA next] (wrap [(list) nextA])) (list.reverse matches))] - (wrap [(//.product-pattern memberP+) + (wrap [(//.pattern/tuple memberP+) thenA]))) _ @@ -246,8 +246,12 @@ (type.variant (list.drop (dec num-cases) flat-sum)) (` [(~+ values)]) next) - (analyse-pattern #.None caseT (` [(~+ values)]) next))] - (wrap [(//.sum-pattern num-cases idx testP) + (analyse-pattern #.None caseT (` [(~+ values)]) next)) + #let [right? (n/= (dec num-cases) idx) + lefts (if right? + (dec idx) + idx)]] + (wrap [(//.pattern/variant [lefts right? testP]) nextA])) _ |