From dc8c03b2a5c70d3169e88d407f3ef28e0cb26af5 Mon Sep 17 00:00:00 2001
From: Matthew Pickering <matthew.pickering@tweag.io>
Date: Thu, 7 Jun 2018 13:31:52 -0400
Subject: Run typeCheckResultAction and renamedResultAction in TcM rather than
 Hsc

The primary motivation for this is that this allows users to access
the warnings and error machinery present in TcM. However, it also allows
users to use TcM actions which means they can typecheck GhcPs which
could be significantly easier than constructing GhcTc.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15229

Differential Revision: https://phabricator.haskell.org/D4792
---
 compiler/main/Plugins.hs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'compiler/main/Plugins.hs')

diff --git a/compiler/main/Plugins.hs b/compiler/main/Plugins.hs
index 34f3298b0d..0ad46bdb99 100644
--- a/compiler/main/Plugins.hs
+++ b/compiler/main/Plugins.hs
@@ -59,13 +59,13 @@ data Plugin = Plugin {
     -- ^ Modify the module when it is parsed. This is called by
     -- HscMain when the parsing is successful.
   , renamedResultAction :: Maybe ([CommandLineOption] -> ModSummary
-                                    -> RenamedSource -> Hsc ())
+                                    -> RenamedSource -> TcM ())
     -- ^ Installs a read-only pass that receives the renamed syntax tree as an
     -- argument when type checking is successful.
   , typeCheckResultAction :: [CommandLineOption] -> ModSummary -> TcGblEnv
-                               -> Hsc TcGblEnv
-    -- ^ Modify the module when it is type checked. This is called by
-    -- HscMain when the type checking is successful.
+                               -> TcM TcGblEnv
+    -- ^ Modify the module when it is type checked. This is called add the
+    -- very end of typechecking.
   , spliceRunAction :: [CommandLineOption] -> LHsExpr GhcTc
                          -> TcM (LHsExpr GhcTc)
     -- ^ Modify the TH splice or quasiqoute before it is run.
-- 
cgit v1.2.1