Skip to content

Commit

Permalink
typecheck input to CodePoint
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Dec 6, 2020
1 parent 8c2f150 commit 9e94421
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e94421

Please sign in to comment.