diff options
author | Xavier Denis <xldenis@gmail.com> | 2019-07-08 14:58:46 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-07-23 11:43:59 -0400 |
commit | 4c7a84627556cda9491300ba61f3060e357bc3ac (patch) | |
tree | d7b01317e98fdb232a6bf9af8cd99c9b2f5f4450 /compiler/main | |
parent | 4854a3490518760405f04826df1768b5a7b96da2 (diff) | |
download | haskell-4c7a84627556cda9491300ba61f3060e357bc3ac.tar.gz |
Make sure to load interfaces when running :instances
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/InteractiveEval.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index ee43aaf675..88c8ecc7df 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -104,7 +104,7 @@ import GHC.Exts import Data.Array import Exception -import TcRnDriver ( runTcInteractive, tcRnType ) +import TcRnDriver ( runTcInteractive, tcRnType, loadUnqualIfaces ) import TcHsSyn ( ZonkFlexi (SkolemiseFlexi) ) import TcEnv (tcGetInstEnvs) @@ -1048,6 +1048,8 @@ getInstancesForType :: GhcMonad m => Type -> m [ClsInst] getInstancesForType ty = withSession $ \hsc_env -> do liftIO $ runInteractiveHsc hsc_env $ do ioMsgMaybe $ runTcInteractive hsc_env $ do + -- Bring class and instances from unqualified modules into scope, this fixes #16793. + loadUnqualIfaces hsc_env (hsc_IC hsc_env) matches <- findMatchingInstances ty fmap catMaybes . forM matches $ uncurry checkForExistence |