X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Typecheck.hs;h=770c079e4bf73259e4a77d36cabc4aaccb310c1e;hp=691b79b269350f18a31e463fc04d72c106502609;hb=80dc2356f0ac48fc4e026e549f85ad1a1d01834b;hpb=97b7064110b10d38c0f75502d08a95550a9a04ba diff --git a/Typecheck.hs b/Typecheck.hs index 691b79b..770c079 100644 --- a/Typecheck.hs +++ b/Typecheck.hs @@ -76,7 +76,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