summaryrefslogtreecommitdiff
path: root/src/GF/Infra/CheckM.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Infra/CheckM.hs')
-rw-r--r--src/GF/Infra/CheckM.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/GF/Infra/CheckM.hs b/src/GF/Infra/CheckM.hs
index efa65118b..a556e5c3a 100644
--- a/src/GF/Infra/CheckM.hs
+++ b/src/GF/Infra/CheckM.hs
@@ -80,9 +80,9 @@ checkGetContext = Check (\ctxt msgs -> Success ctxt ctxt msgs)
checkLookup :: Ident -> Check Type
checkLookup x = do
co <- checkGetContext
- case lookup x co of
- Nothing -> checkError (text "unknown variable" <+> ppIdent x)
- Just ty -> return ty
+ case [ty | (b,y,ty) <- co, x == y] of
+ [] -> checkError (text "unknown variable" <+> ppIdent x)
+ (ty:_) -> return ty
runCheck :: Check a -> Either [Message] (a,Context,[Message])
runCheck c =