summaryrefslogtreecommitdiff
path: root/compiler/main/InteractiveEval.hs
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2016-04-22 22:39:17 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2016-06-23 15:17:43 -0400
commit8035d1a5dc7290e8d3d61446ee4861e0b460214e (patch)
tree2e517feff25329abb942184ac4a7d20c9f77ba29 /compiler/main/InteractiveEval.hs
parent9a34bf1985035858ece043bf38b47b6ff4b88efb (diff)
downloadhaskell-8035d1a5dc7290e8d3d61446ee4861e0b460214e.tar.gz
Fix #10963 and #11975 by adding new cmds to GHCi.
See the user's guide entry or the Note [TcRnExprMode] in TcRnDriver. Test cases: ghci/scripts/T{10963,11975}
Diffstat (limited to 'compiler/main/InteractiveEval.hs')
-rw-r--r--compiler/main/InteractiveEval.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs
index 6c95dc3bcc..9877e9a0c7 100644
--- a/compiler/main/InteractiveEval.hs
+++ b/compiler/main/InteractiveEval.hs
@@ -864,10 +864,10 @@ parseThing parser dflags stmt = do
-- Getting the type of an expression
-- | Get the type of an expression
--- Returns its most general type
-exprType :: GhcMonad m => String -> m Type
-exprType expr = withSession $ \hsc_env -> do
- ty <- liftIO $ hscTcExpr hsc_env expr
+-- Returns the type as described by 'TcRnExprMode'
+exprType :: GhcMonad m => TcRnExprMode -> String -> m Type
+exprType mode expr = withSession $ \hsc_env -> do
+ ty <- liftIO $ hscTcExpr hsc_env mode expr
return $ tidyType emptyTidyEnv ty
-- -----------------------------------------------------------------------------