summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcRnTypes.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/typecheck/TcRnTypes.hs')
-rw-r--r--compiler/typecheck/TcRnTypes.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs
index 49df7a909a..8a299d3d50 100644
--- a/compiler/typecheck/TcRnTypes.hs
+++ b/compiler/typecheck/TcRnTypes.hs
@@ -911,7 +911,12 @@ removeBindingShadowing bindings = reverse $ fst $ foldl
data SpliceType = Typed | Untyped
-data ThStage -- See Note [Template Haskell state diagram] in TcSplice
+data ThStage -- See Note [Template Haskell state diagram]
+ -- and Note [Template Haskell levels] in TcSplice
+ -- Start at: Comp
+ -- At bracket: wrap current stage in Brack
+ -- At splice: currently Brack: return to previous stage
+ -- currently Comp/Splice: compile and run
= Splice SpliceType -- Inside a top-level splice
-- This code will be run *at compile time*;
-- the result replaces the splice
@@ -980,11 +985,10 @@ outerLevel = 1 -- Things defined outside brackets
thLevel :: ThStage -> ThLevel
thLevel (Splice _) = 0
-thLevel (RunSplice _) =
- -- See Note [RunSplice ThLevel].
- panic "thLevel: called when running a splice"
thLevel Comp = 1
thLevel (Brack s _) = thLevel s + 1
+thLevel (RunSplice _) = panic "thLevel: called when running a splice"
+ -- See Note [RunSplice ThLevel].
{- Node [RunSplice ThLevel]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~