[GHC] #11647: GHCi does not honour implicit `module Main (main) where` for re-exported `main`s

An abbreviated form of module, consisting only of the module body, is
#11647: GHCi does not honour implicit `module Main (main) where` for re-exported `main`s -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Haskell2010 states: permitted. If this is used, the header is assumed to be `module Main(main) where`. Consider the following two modules: {{{#!hs -- module Main (main) where import Main2 (main) }}} {{{#!hs module Main2 (main) where main :: IO () main = return () }}} A non-interactive GHC happily compiles `ghc --make Main`, however, GHCi fails with {{{ $ ghci Main.hs GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help unknown option: 'c' [1 of 2] Compiling Main2 ( Main2.hs, interpreted ) [2 of 2] Compiling Main ( Main.hs, interpreted ) Main.hs:1:1: The IO action ‘main’ is not exported by module ‘Main’ Failed, modules loaded: Main2. }}} For GHCi we need to uncomment the explicit `module Main (main) where` line to make it work. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11647 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11647: GHCi does not honour implicit `module Main (main) where` for re-exported `main`s -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by hvr): * failure: None/Unknown => GHC rejects valid program -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11647#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11647: GHCi does not honour implicit `module Main (main) where` for re-exported `main`s -------------------------------------+------------------------------------- Reporter: hvr | Owner: RolandSenn Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * owner: (none) => RolandSenn Comment: I'll work on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11647#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11647: GHCi does not honour implicit `module Main (main) where` for re-exported `main`s -------------------------------------+------------------------------------- Reporter: hvr | Owner: RolandSenn Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: make test valid program | TEST=T11647 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5162 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * status: new => patch * testcase: => make test TEST=T11647 * differential: => Phab:D5162 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11647#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11647: GHCi does not honour implicit `module Main (main) where` for re-exported `main`s -------------------------------------+------------------------------------- Reporter: hvr | Owner: RolandSenn Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: GHCi | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: make test valid program | TEST=T11647 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5162 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * milestone: => 8.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11647#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11647: GHCi does not honour implicit `module Main (main) where` for re-exported
`main`s
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: RolandSenn
Type: bug | Status: patch
Priority: normal | Milestone: 8.8.1
Component: GHCi | Version: 7.10.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: GHC rejects | Test Case: make test
valid program | TEST=T11647
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5162
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski

#11647: GHCi does not honour implicit `module Main (main) where` for re-exported `main`s -------------------------------------+------------------------------------- Reporter: hvr | Owner: RolandSenn Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: GHCi | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: make test valid program | TEST=T11647 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5162 Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11647#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC