Commit 400f3ed8 authored by Roland Senn's avatar Roland Senn Committed by Krzysztof Gogolewski

GHCi does not need a main function

Summary: In GHCi we don't check anymore, whether a main function is exported.

Test Plan: make test TEST=T11647

Reviewers: hvr, osa1, monoidal, mpickering, bgamari

Reviewed By: osa1, mpickering

Subscribers: rwbarton, carter

GHC Trac Issues: #11647

Differential Revision: https://phabricator.haskell.org/D5162
parent 63a81707
......@@ -1758,9 +1758,11 @@ checkMainExported tcg_env
Just main_name ->
do { dflags <- getDynFlags
; let main_mod = mainModIs dflags
; checkTc (main_name `elem` concatMap availNames (tcg_exports tcg_env)) $
text "The" <+> ppMainFn (nameRdrName main_name) <+>
text "is not exported by module" <+> quotes (ppr main_mod) }
; when (ghcLink dflags /= LinkInMemory) $ -- #11647
checkTc (main_name `elem`
concatMap availNames (tcg_exports tcg_env)) $
text "The" <+> ppMainFn (nameRdrName main_name) <+>
text "is not exported by module" <+> quotes (ppr main_mod) }
ppMainFn :: RdrName -> SDoc
ppMainFn main_fn
......
module T11647Sub (main) where
main :: IO ()
main = return ()
......@@ -125,6 +125,7 @@ test('TestTypeableBinary', normal, compile_and_run, [''])
test('Typeable1', normal, compile_fail, ['-Werror'])
test('TypeableEq', normal, compile_and_run, [''])
test('T13435', normal, compile_and_run, [''])
test('T11647', normal, ghci_script, ['T11647.script'])
test('T11715', exit_code(1), compile_and_run, [''])
test('T13594a', normal, ghci_script, ['T13594a.script'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment