From: Mart Lubbers Date: Wed, 13 Apr 2016 20:14:59 +0000 (+0200) Subject: - X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=17a18d09526365443a710bb1fb7728d5c1f8ceea;p=cc1516.git - --- diff --git a/sem.icl b/sem.icl index 66d9024..475d093 100644 --- a/sem.icl +++ b/sem.icl @@ -135,7 +135,7 @@ typeExpr (VarExpr p (VarDef ident fs)) = gets (\(st, r)->'Map'.get ident st) Just t = unify t fs typeOp2 :: Expr Expr Op2 [Type] Type -> Env Type typeOp2 e1 e2 op ts ret = typeExpr e1 >>= \t1-> typeExpr e2 >>= \t2-> - unify t1 t2 >>= \t3->if (isMember t3 ts) (pure ret) + unify t1 t2 >>= \t3->if (isMember t3 [IdType "":ts]) (pure ret) (liftT $ Left $ OperatorError (extrPos e1) op t3) buildFunctionType :: String [Expr] -> Env Type