[GHC] #7765: Odd error message for `runghc` with missing `main` function.

#7765: Odd error message for `runghc` with missing `main` function. -----------------------------+---------------------------------------------- Reporter: isaacdupree | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.1 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- {{{ % cat what.hs module Main where {} % runghc what.hs what.hs:1:33: Not in scope: `main' Perhaps you meant `min' (imported from Prelude) }}} '`ghc what.hs`' gives a rather more sensible message. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7765 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7765: Odd error message for `runghc` with missing `main` function. ---------------------------------+------------------------------------------ Reporter: isaacdupree | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by simonpj): * owner: => igloo * difficulty: => Unknown Comment: Nothing to do with `runghc` really; its the `-e` mode: {{{ ghc -e wombat what.hs <interactive>:1:1: Not in scope: ‛womab’ }}} But really it should say {{{ what.hs:1:33: Not in scope: `main' Perhaps you meant `min' (imported from Prelude) }}} I'm not sure where the `-e` processing happens, and couldn't find it with a quick look. Ian, you've been refactoring the pipeline recently, might you look? Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7765#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7765: Odd error message for `runghc` with missing `main` function. ---------------------------------+------------------------------------------ Reporter: isaacdupree | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by igloo): I'm confused - doesn't it already say that? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7765#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7765: Odd error message for `runghc` with missing `main` function. ---------------------------------+------------------------------------------ Reporter: isaacdupree | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by simonpj): Oh, sorry, I meant that it should say {{{ what.hs:1:1: The function `main' is not defined in module `Main' }}} If instead it was {{{ module What2 where foo = True }}} and you said {{{ ght -e bar What2.hs }}} then a "not in scope" message would make more sense. But in the common case of 'main' (which is what happens with `runghc`), the `No main in Main` message is better Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7765#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7765: Odd error message for `runghc` with missing `main` function. ---------------------------------+------------------------------------------ Reporter: isaacdupree | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.6.1 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * milestone: => 7.8.1 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7765#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC