From 9e94421f4416f415c4728ace138f0d05ae266372 Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Sun, 6 Dec 2020 22:37:41 +0000 Subject: [PATCH] typecheck input to CodePoint --- src/lib/Type.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/Type.hs b/src/lib/Type.hs index 8b8834bfc..25c9f4dfa 100644 --- a/src/lib/Type.hs +++ b/src/lib/Type.hs @@ -728,9 +728,10 @@ typeCheckOp op = case op of i |: TC (IntRange (IdxRepVal 0) (IdxRepVal $ fromIntegral vectorWidth)) return $ BaseTy $ Scalar sb ThrowError ty -> ty|:TyKind $> ty - -- TODO: type check that c is a character -- TODO: this should really be a 32 bit integer for unicode code point: but for now is 8 bit ASCII code point - CodePoint c -> return $ BaseTy $ Scalar Int8Type + CodePoint c -> do + c |: CharTy + return $ BaseTy $ Scalar Int8Type CastOp t@(Var _) _ -> t |: TyKind $> t CastOp destTy e -> do sourceTy <- typeCheck e