[GHC] #11256: ghc --make reports bad import errors too eagerly

GHC ghc-devs at haskell.org
Sat Dec 19 02:47:41 UTC 2015


#11256: ghc --make reports bad import errors too eagerly
-------------------------------------+-------------------------------------
           Reporter:  ezyang         |             Owner:  ezyang
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.0.1
          Component:  Compiler       |           Version:  7.11
           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:
-------------------------------------+-------------------------------------
 Consider this A.hs file, with a valid header (no B.hs file) and a syntax
 error:

 {{{
 module A where
 import B

 = as7df89a235r a23jk @A#$(&#$A
 }}}

 We get different behavior when one-shot compiling and make compiling:

 {{{
 ezyang at sabre:~$ ghc -c A.hs

 A.hs:4:1: parse error on input `='
 ezyang at sabre:~$ ghc --make A.hs

 A.hs:2:8:
     Could not find module `B'
     Use -v to see a list of the files searched for.
 }}}

 I feel like the `--make` error is wrong, and we shouldn't actually
 complain that an import is missing until we build it.  But it cuts both
 ways; if you have a big module graph and you try to `--make`, currently
 `--make` will report instantaneously if any import is wrong; if we changed
 this behavior, `--make` would chug along until it actually tried to
 compile the offending file.

 It's easy to fix and I can easily submit a patch for it, if people think
 we should defer the error. Doing this will also let me remove a grievous
 hack from my fix to #11244.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11256>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list