Properly handle boolean patterns in the new runtime

This commit is contained in:
Dan Doel 2021-02-10 16:00:10 -05:00
parent beec380cd2
commit e5d98a2b76

View File

@ -145,6 +145,10 @@ decomposePattern
:: Var v
=> Reference -> Int -> Int -> P.Pattern v
-> [[P.Pattern v]]
decomposePattern rf0 t _ (P.Boolean _ b)
| rf0 == Rf.booleanRef
, t == if b then 1 else 0
= [[]]
decomposePattern rf0 t nfields p@(P.Constructor _ rf u ps)
| t == u
, rf0 == rf