Commit df4a5e21 authored by Jan Rasmus Tikovsky 's avatar Jan Rasmus Tikovsky
Browse files

Typecheck record labels after initialization of type constructor environment

parent 18f66e93
...@@ -74,12 +74,11 @@ typeCheck :: ModuleIdent -> TCEnv -> ValueEnv -> [Decl] ...@@ -74,12 +74,11 @@ typeCheck :: ModuleIdent -> TCEnv -> ValueEnv -> [Decl]
-> (TCEnv, ValueEnv, [Message]) -> (TCEnv, ValueEnv, [Message])
typeCheck m tcEnv tyEnv decls = execTCM check initState typeCheck m tcEnv tyEnv decls = execTCM check initState
where where
check = checkTypeSynonyms m tds &&> mapM_ checkFieldLabel tds check = checkTypeSynonyms m tds &&> checkDecls
&&> checkDecls
checkDecls = do checkDecls = do
bindTypes tds bindTypes tds
bindConstrs bindConstrs
bindLabels mapM_ checkFieldLabel tds &&> bindLabels
tcDecls vds tcDecls vds
(tds, vds) = partition isTypeDecl decls (tds, vds) = partition isTypeDecl decls
initState = TcState m tcEnv tyEnv idSubst emptySigEnv 0 [] initState = TcState m tcEnv tyEnv idSubst emptySigEnv 0 []
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment