compiler: fix case on Bool type [skip bamboo]
diff --git a/cogent/src/Cogent/Desugar.hs b/cogent/src/Cogent/Desugar.hs index 5c46e4b..47e1e6d 100644 --- a/cogent/src/Cogent/Desugar.hs +++ b/cogent/src/Cogent/Desugar.hs
@@ -542,7 +542,8 @@ desugarExpr $ B.TE (B.getTypeTE e) (S.Let [b1,b2] e) pos desugarAlt' e0 (S.PIrrefutable (B.TIP (S.PArrayTake arr ips) pos)) e = __todo "desugarAlts': taking multiple elements out of an array is currently not supported" #endif -desugarAlt' _ _ _ = __impossible "desugarAlt' (_)" -- literals +desugarAlt' e0 (S.PBoolLit b) e = desugarExpr e +desugarAlt' _ _ _ = __impossible "desugarAlt' (_)" -- literals that cannot be easily exhausted desugarPrimInt :: B.DepType -> PrimInt desugarPrimInt (B.DT (S.TCon "U8" [] Unboxed)) = U8
diff --git a/cogent/tests/tests/case/pass_case-bool.cogent b/cogent/tests/tests/case/pass_case-bool.cogent new file mode 100644 index 0000000..0b6098f --- /dev/null +++ b/cogent/tests/tests/case/pass_case-bool.cogent
@@ -0,0 +1,3 @@ +foo : Bool -> <T | F> +foo | True -> F + | False -> T