Commit d2761231 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Fix Trac #5721; type variables can be quoted in TH

parent 276c0527
...@@ -369,14 +369,15 @@ tc_bracket :: ThStage -> HsBracket Name -> TcM TcType ...@@ -369,14 +369,15 @@ tc_bracket :: ThStage -> HsBracket Name -> TcM TcType
tc_bracket outer_stage br@(VarBr _ name) -- Note [Quoting names] tc_bracket outer_stage br@(VarBr _ name) -- Note [Quoting names]
= do { thing <- tcLookup name = do { thing <- tcLookup name
; case thing of ; case thing of
AGlobal _ -> return () AGlobal {} -> return ()
ATyVar {} -> return ()
ATcId { tct_level = bind_lvl, tct_id = id } ATcId { tct_level = bind_lvl, tct_id = id }
| thTopLevelId id -- C.f TcExpr.checkCrossStageLifting | thTopLevelId id -- C.f TcExpr.checkCrossStageLifting
-> keepAliveTc id -> keepAliveTc id
| otherwise | otherwise
-> do { checkTc (thLevel outer_stage + 1 == bind_lvl) -> do { checkTc (thLevel outer_stage + 1 == bind_lvl)
(quotedNameStageErr br) } (quotedNameStageErr br) }
_ -> pprPanic "th_bracket" (ppr name) _ -> pprPanic "th_bracket" (ppr name $$ ppr thing)
; tcMetaTy nameTyConName -- Result type is Var (not Q-monadic) ; tcMetaTy nameTyConName -- Result type is Var (not Q-monadic)
} }
......
Markdown is supported
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