summaryrefslogtreecommitdiff
path: root/testsuite/tests/plugins
diff options
context:
space:
mode:
authorMatthew Pickering <matthew.pickering@tweag.io>2018-06-07 13:31:52 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-07 18:06:30 -0400
commitdc8c03b2a5c70d3169e88d407f3ef28e0cb26af5 (patch)
treea3ae0e90a74335433c87d2248891900d38b2efb8 /testsuite/tests/plugins
parentfa34ced5204b13ba809a3441a89b9cf98de2d54e (diff)
downloadhaskell-dc8c03b2a5c70d3169e88d407f3ef28e0cb26af5.tar.gz
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
Diffstat (limited to 'testsuite/tests/plugins')
-rw-r--r--testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs2
-rw-r--r--testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs4
2 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs
index c64b62f8a7..2d14eeaf85 100644
--- a/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs
+++ b/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs
@@ -39,7 +39,7 @@ removeParsedBinding name (L l m)
= occNameString (rdrNameOcc fid) /= name
notNamedAs _ _ = True
-typecheckPlugin :: [CommandLineOption] -> ModSummary -> TcGblEnv -> Hsc TcGblEnv
+typecheckPlugin :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv
typecheckPlugin [name, "typecheck"] _ tc
= return $ tc { tcg_exports = filter (availNotNamedAs name) (tcg_exports tc)
, tcg_binds = filterBag (notNamedAs name) (tcg_binds tc)
diff --git a/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs
index d5c9dd1856..85fc870604 100644
--- a/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs
+++ b/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs
@@ -31,11 +31,11 @@ parsedPlugin opts _ pm
renamedAction :: [CommandLineOption] -> ModSummary
-> ( HsGroup GhcRn, [LImportDecl GhcRn]
, Maybe [(LIE GhcRn, Avails)], Maybe LHsDocString )
- -> Hsc ()
+ -> TcM ()
renamedAction _ _ ( gr, _, _, _ )
= liftIO $ putStrLn "typeCheckPlugin (rn)"
-typecheckPlugin :: [CommandLineOption] -> ModSummary -> TcGblEnv -> Hsc TcGblEnv
+typecheckPlugin :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv
typecheckPlugin _ _ tc
= do liftIO $ putStrLn "typeCheckPlugin (tc)"
return tc