From 78b64e87c131dade66dd7d88698fabc78b024b83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anders=20M=C3=B6rtberg?= Date: Sun, 29 Mar 2015 19:05:49 +0200 Subject: [PATCH] Fix error message when path constructors are written without the type in curly braces --- Resolver.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Resolver.hs b/Resolver.hs index a13817f..40fd0ec 100644 --- a/Resolver.hs +++ b/Resolver.hs @@ -138,7 +138,10 @@ resolveVar (AIdent (l,x)) case lookup x vars of Just Variable -> return $ CTT.Var x Just Constructor -> return $ CTT.Con x [] - Just PConstructor -> undefined -- error! + Just PConstructor -> throwError $ "The path constructor " ++ x ++ " is used as a" + ++ " variable at " ++ show l ++ " in " ++ modName + ++ " (path constructors should have their type in" + ++ " curly braces as first argument)" Just Name -> throwError $ "Name " ++ x ++ " used as a variable at position " ++ show l ++ " in module " ++ modName -- 2.34.1