From a86031403d792792b41d8ae3795e3281b8876c63 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 4 Sep 2022 14:00:27 +0100 Subject: Revert "Unneeded (duplicated) case" It is actually needed because when we resolve the parameters it is possible some of them are wrong and we may end with a number of "right" that is less than the number of parameters we had initially. This reverts commit 72dc8f0490a26c2438b5eff9fe29a3197036d6e5. --- src/Compiler.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Compiler.hs b/src/Compiler.hs index 1dfe4d9..0511644 100644 --- a/src/Compiler.hs +++ b/src/Compiler.hs @@ -49,6 +49,7 @@ typecheckCall args params targs <- fmap rights $ traverse compile args case sequence targs of Just t + | length t /= length params -> return $ Nothing | all (\(a, b) -> a == b) $ zip t params -> -- compare types return $ Nothing -- all good! | otherwise -> return $ Just ("type mismatch in function call\n found: " ++ A.showList t ++ "\n expected: " ++ A.showList params) -- cgit v1.2.3