id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5243,ghc --make and ghci misses dependencies with explicit braces,simonpj,simonmar,"Karl Crary tripped over this deeply strange case:
{{{
Bar.hs
   module Bar where
   bar = True

Main.hs
   { import Bar; main = print bar }
}}}
Notice that `Main.hs` is missing its ""`module Main where`"" part, but has explicit braces and semicolons.  The BNF in the language standard says that is fine.

If you compile them one at a time all is well:
{{{
ghc -c Bar.hs
ghc -c Main.hs 
}}}
But if you use `--make` it breaks:
{{{
simonpj@cam-04-unx:~/tmp$ ghc --make Main -ddump-parsed -ddump-rn
[1 of 1] Compiling Main             ( Main.hs, Main.o )

==================== Parser ====================
import Bar
main = print foo

Main.hs:1:29: Not in scope: `foo'
}}}
Bizarre, eh?  This is ghc 7.0.3.  It's as if `--make` somehow ignores the import of `Bar`, even though it is parsed just fine.

Simon",bug,closed,high,7.2.1,Compiler,7.0.3,fixed,,crary@…,Unknown/Multiple,Unknown/Multiple,GHC rejects valid program,,parser/should_compile/T5243,,,
