@@ -139,4 +139,5 @@ typeCheckAll (ImportDeclaration modulePath idents : rest) = do
139139 forM_ idents $ \ident ->
140140 case M.lookup (modulePath, ident) (names env) of
141141 Nothing -> throwError $ show modulePath ++ "." ++ show ident ++ " is undefined"
142− Just (pt, _) -> putEnv (env { names = M.insert (omp, ident) (pt, Alias modulePath ident) (names env) })
142+ Just (pt, _) -> getEnv >>= \env' ->
143+ putEnv (env' { names = M.insert (omp, ident) (pt, Alias modulePath ident) (names env') })