aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Dybiec <pawel.to.malpa@gmail.com>2020-01-09 18:13:26 +0100
committerPaweł Dybiec <pawel.to.malpa@gmail.com>2020-01-09 18:13:26 +0100
commite623b6bb4103f8dda9ed51ae5e0a53343aa76621 (patch)
tree8fee35fdb223b5b92f1b6d70754c6e21d2e62d10 /src
parentFix variant type (diff)
Fix asserts
Diffstat (limited to 'src')
-rw-r--r--src/Typecheck.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Typecheck.hs b/src/Typecheck.hs
index 02b9871..716f15f 100644
--- a/src/Typecheck.hs
+++ b/src/Typecheck.hs
@@ -8,11 +8,11 @@ type Environment = [(Idnt,Typ)]
assertInt TInt = Just ()
assertInt _ = Nothing
-assertRec (Record _) = Just ()
+assertRec (TRecord ts) = Just ts
assertRec _ = Nothing
-assertVar (Variant _ _) = Just ()
+assertVar (TVariant ts) = Just ts
assertVar _ = Nothing
-assertPtr (TPtr _) = Just ()
+assertPtr (TPtr t) = Just t
assertPtr _ = Nothing
inferExpr :: Expr -> Environment -> Maybe Typ