X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Typecheck.hs;h=6f65d6e2f538d18d554787225c4aa138918a586f;hb=3cee522d1f54b39a1efa654da364c6c939cbcf1f;hp=691b79b269350f18a31e463fc04d72c106502609;hpb=b2a94f77235a88731d63a1251f53720f869492c8;p=proglang.git diff --git a/Typecheck.hs b/Typecheck.hs index 691b79b..6f65d6e 100644 --- a/Typecheck.hs +++ b/Typecheck.hs @@ -1,5 +1,6 @@ module Typecheck (typeCheckExp, typeCheckStm, typeCheckVar) where + import Abssyntax import Control.Monad.State import Data.Map as Map @@ -76,7 +77,7 @@ typeCheckStm (SDecl t i e) = do t2 <- typeCheckExp e if t == t2 || t2 == NoType then do (m:ms) <- get - case insertLookupWithKey (\k a1 a2 -> a1) i t m of + case insertLookupWithKey (\k a1 a2 -> a1) i t m of (Nothing,m') -> put (m':ms) _ -> fail $ "Duplicate variable declaration: "++show i return NoType