X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcSplice.lhs;fp=compiler%2Ftypecheck%2FTcSplice.lhs;h=abba313e5c1fc28a4d2c7eb1a8dd79e1855a0b73;hp=bafddf8e3582334039af4bbb7353f85176f17ce0;hb=786932468faac49aafe20b65eabc8bdf465fbc9d;hpb=f03b9562a92c6ef94c603a334d5d5e1cd2165c92 diff --git a/compiler/typecheck/TcSplice.lhs b/compiler/typecheck/TcSplice.lhs index bafddf8..abba313 100644 --- a/compiler/typecheck/TcSplice.lhs +++ b/compiler/typecheck/TcSplice.lhs @@ -338,9 +338,12 @@ tcBracket brack res_ty -- it again when we actually use it. ; pending_splices <- newMutVar [] ; lie_var <- getLIEVar + ; let brack_stage = Brack cur_stage pending_splices lie_var + + ; (meta_ty, lie) <- setStage brack_stage $ + getLIE $ + tc_bracket cur_stage brack - ; (meta_ty, lie) <- setStage (Brack cur_stage pending_splices lie_var) - (getLIE (tc_bracket cur_stage brack)) ; tcSimplifyBracket lie -- Make the expected type have the right shape @@ -381,6 +384,10 @@ tc_bracket _ (DecBrG decls) = do { _ <- tcTopSrcDecls emptyModDetails decls -- Typecheck the declarations, dicarding the result -- We'll get all that stuff later, when we splice it in + + -- Top-level declarations in the bracket get unqualified names + -- See Note [Top-level Names in Template Haskell decl quotes] in RnNames + ; tcMetaTy decsQTyConName } -- Result type is Q [Dec] tc_bracket _ (PatBr pat)