Parser error shadowed by "module ‘main:Main’ is defined in multiple files" error
Consider the following two (invalid) modules M1
and M2
:
# 1 "<built-in>" 1
module M1 where
and
# 1 "<built-in>" 1
module M2 where
When those are compiled separately by GHC, they result in the following error:
$ ghc -c -Wall M1.hs
M1.hs:1:2: parse error on input ‘#’
ghc -c -Wall M2.hs
M2.hs:1:2: parse error on input ‘#’
However, when compiled simultaneously, the modules get seemingly parsed as Main
-modules (which then conflict with each others):
ghc --make -Wall M1.hs M2.hs
<no location info>:
module ‘main:Main’ is defined in multiple files: M1.hs M2.hs
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.1-rc2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |