Fix bad inference on case expression, and make pretty for report

This commit is contained in:
Martin Fredin 2023-04-08 21:52:57 +02:00
parent 29de6c49e4
commit a109b3010d
6 changed files with 406 additions and 391 deletions

View file

@ -260,6 +260,17 @@ tc_pol_case = describe "Polymophic and recursive pattern matching" $ do
, " Cons (Cons _ ys) xs => 1 + elems (Cons ys xs)"
]
tc_if = specify "Test if else case expression" $ do
run [ "data Bool () where"
, " True : Bool ()"
, " False : Bool ()"
, "ifThenElse : Bool () -> a -> a -> a"
, "ifThenElse b if else = case b of"
, " True => if"
, " False => else"
] `shouldSatisfy` ok
tc_infer_case = describe "Infer case expression" $ do
specify "Wrong case expression rejected" $