From 9e67d68574bf4b78451469d5e149cfd95b0ec9f6 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 2 Feb 2017 09:41:01 +0100 Subject: Pointer arithmetic now also for Minus string_index.nl now doesn't compile anymore because I need to implement casts from i32 to u64 --- check.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'check.hs') diff --git a/check.hs b/check.hs index 65c1470..b30ff25 100644 --- a/check.hs +++ b/check.hs @@ -215,7 +215,9 @@ resultTypeBO :: BinaryOperator -> Type -> Type -> Maybe Type resultTypeBO Minus (TypePtr t1) (TypePtr t2) | t1 == t2 = Just $ TypeUInt 1 resultTypeBO bo (TypePtr t1) (TypePtr t2) | t1 == t2 && bo `elem` complogBO = Just $ TypeUInt 1 resultTypeBO bo t@(TypePtr _) (TypeInt _) | bo `elem` [Plus, Minus] = Just t +resultTypeBO bo t@(TypePtr _) (TypeUInt _) | bo `elem` [Plus, Minus] = Just t resultTypeBO bo (TypeInt _) t@(TypePtr _) | bo `elem` [Plus, Minus] = Just t +resultTypeBO bo (TypeUInt _) t@(TypePtr _) | bo `elem` [Plus, Minus] = Just t resultTypeBO _ (TypePtr _) _ = Nothing resultTypeBO _ _ (TypePtr _) = Nothing -- cgit v1.2.3-54-g00ecf