
#11120: Missing type representations -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1774 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari):
Yes it is! We typecheck the module before generating those extra bindings. So the definitions will be in the type environment, won't they?
Ahh, I think we were talking about different things. The `TyCon` bindings are indeed generated after type checking the module's type declarations. However, this is not the case for the `Module` binding: Generating it is literally the first thing done by `tcRnSrcDecls`, {{{#!hs tcRnSrcDecls explicit_mod_hdr decls = do { -- Create a binding for $trModule -- Do this before processing any data type declarations, -- which need tcg_tr_module to be initialised ; tcg_env <- mkModIdBindings ; tcg_env <- setGblEnv tcg_env mkPrimTypeableBinds -- Do all the declarations ; ((tcg_env, tcl_env), lie) <- setGblEnv tcg_env $ captureConstraints $ do { (tcg_env, tcl_env) <- tc_rn_src_decls decls ; ; tcg_env <- setEnvs (tcg_env, tcl_env) $ checkMain explicit_mod_hdr ; return (tcg_env, tcl_env) } ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11120#comment:38 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler