diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-02-23 03:38:26 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-02-23 03:38:27 -0600 |
commit | 0fa20726b0587530712677e50a56c2b03ba43095 (patch) | |
tree | b82eaaf4828a17dfc72845ac11a918feed801bc3 /testsuite/tests/module/mod174.hs | |
parent | b2be772a97f6e7fe9f1d1c28108949f81a13158b (diff) | |
download | haskell-0fa20726b0587530712677e50a56c2b03ba43095.tar.gz |
Error out on `Main` without `main` in GHCi (#7765)
Summary:
GHC does 2 validation checks for module `Main`:
* does `main` exist
* is `main` exported (#414)
The second check is done in ghc as well as in ghci (and runghc and ghc -e).
The first check however is currently not done in ghci, to prevent "'main' is
not in scope" errors when loading simple scripts. See commit d28ba8c8009 for
more information.
This commit tightens the special case for ghci. When the file does not contain
a main function, but does contain an explicit module header (i.e. "module Main
where"), then /do/ raise an error in ghci (and runghc and ghc -e) as well
Test Plan:
module/T7765: a module Main with an explicit module header but without a
main function should be an error for all Ways.
Additionaly: delete test module/mod174. It was added in commit 5a54c38, but it
is a duplicate of module/T414.
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D649
GHC Trac Issues: #7765
Diffstat (limited to 'testsuite/tests/module/mod174.hs')
-rw-r--r-- | testsuite/tests/module/mod174.hs | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/testsuite/tests/module/mod174.hs b/testsuite/tests/module/mod174.hs deleted file mode 100644 index 8e8149db7a..0000000000 --- a/testsuite/tests/module/mod174.hs +++ /dev/null @@ -1,9 +0,0 @@ - --- Test for trac #414 --- If main is not exported from Main then we should emit an error --- instead of running it anyway - -module Main () where - -main = putStrLn "Hello, World" - |