diff options
-rw-r--r-- | src/Typecheck.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Typecheck.hs b/src/Typecheck.hs index 716f15f..f6621a0 100644 --- a/src/Typecheck.hs +++ b/src/Typecheck.hs @@ -26,19 +26,19 @@ inferExpr (Variant t v e) env = do return t inferExpr (Add e1 e2) env = do checkExpr e1 env TInt - checkExpr e1 env TInt + checkExpr e2 env TInt return TInt inferExpr (Mult e1 e2) env = do checkExpr e1 env TInt - checkExpr e1 env TInt + checkExpr e2 env TInt return TInt inferExpr (Neg e) env = do checkExpr e env TInt return TInt inferExpr (Deref e1) env = do t <- inferExpr e1 env - assertPtr t - return t + tt <- assertPtr t + return tt checkExpr :: Expr -> Environment -> Typ -> Maybe () checkExpr e env t = do |