summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorromes <rodrigo.m.mesquita@gmail.com>2023-02-13 11:43:37 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-02-14 11:34:25 -0500
commit85a1a575f9909bbfa84268a9744f22ca0f0a1593 (patch)
tree143e8577223514713fc5a577f969057b6fb8004c /ghc
parente8baecd20cbd764a081c6195959719d4c73e65a8 (diff)
downloadhaskell-85a1a575f9909bbfa84268a9744f22ca0f0a1593.tar.gz
fix: Mark ghci Prelude import as implicit
Fixes #22829 In GHCi, we were creating an import declaration for Prelude but we were not setting it as an implicit declaration. Therefore, ghci's import of Prelude triggered -Wmissing-import-lists. Adds regression test T22829 to testsuite
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 418502f306..58c446fb43 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -556,7 +556,10 @@ interactiveUI config srcs maybe_exprs = do
default_editor <- liftIO $ findEditor
eval_wrapper <- mkEvalWrapper default_progname default_args
- let prelude_import = simpleImportDecl preludeModuleName
+ let prelude_import =
+ case simpleImportDecl preludeModuleName of
+ -- Set to True because Prelude is implicitly imported.
+ impDecl@ImportDecl{ideclExt=ext} -> impDecl{ideclExt = ext{ideclImplicit=True}}
hsc_env <- GHC.getSession
let in_multi = length (hsc_all_home_unit_ids hsc_env) > 1
empty_cache <- liftIO newIfaceCache