Fix #481: use a safe recompilation check when Template Haskell is
[ghc.git] / compiler / deSugar / Desugar.lhs
index 5d045a8..93b444c 100644 (file)
@@ -61,7 +61,8 @@ deSugar hsc_env
                            tcg_imports      = imports,
                            tcg_exports      = exports,
                            tcg_keep         = keep_var,
-                           tcg_rdr_env      = rdr_env,
+                            tcg_th_splice_used = tc_splice_used,
+                            tcg_rdr_env      = rdr_env,
                            tcg_fix_env      = fix_env,
                            tcg_inst_env     = inst_env,
                            tcg_fam_inst_env = fam_inst_env,
@@ -147,13 +148,16 @@ deSugar hsc_env
         ; let used_names = mkUsedNames tcg_env
         ; deps <- mkDependencies tcg_env
 
-        ; let mod_guts = ModGuts {     
+        ; used_th <- readIORef tc_splice_used
+
+        ; let mod_guts = ModGuts {
                mg_module       = mod,
                mg_boot         = isHsBoot hsc_src,
                mg_exports      = exports,
                mg_deps         = deps,
                mg_used_names   = used_names,
-               mg_dir_imps     = imp_mods imports,
+                mg_used_th      = used_th,
+                mg_dir_imps     = imp_mods imports,
                mg_rdr_env      = rdr_env,
                mg_fix_env      = fix_env,
                mg_warns        = warns,