GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T19:15:29Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/1051Insufficient location information for parse errors before ''module'' keyword2019-07-07T19:15:29ZnfrisbyInsufficient location information for parse errors before ''module'' keywordI've seen this error with GHC 6.6 on a PPC Mac (10.4.8), but I suspect it happens on multiple systems.
Consider *Main.hs*
```
module Main where
import Test
main = test
```
and *Test.hs*
```
mmmodule Test where
test = putStr "stutt...I've seen this error with GHC 6.6 on a PPC Mac (10.4.8), but I suspect it happens on multiple systems.
Consider *Main.hs*
```
module Main where
import Test
main = test
```
and *Test.hs*
```
mmmodule Test where
test = putStr "stutter"
```
The error message for trying to load the Main module is
```
$ ghci Main
[snip]
Loading package base ... linking ... done.
<no location info>: file name does not match module name `Main'
Failed, modules loaded: none.
Prelude>
```
This provides no information regarding the actual location of the error. In a program of a considerable number of modules, the offending module can be difficult to track down. Moreover, the error provides no direct indication that there's a source file without the module keyword in it.
The path of the offending file should be included in the error.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 6.6 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Multiple |
| Architecture | Multiple |
</details>
<!-- {"blocked_by":[],"summary":"Insufficient location information for parse errors before ''module'' keyword","status":"New","operating_system":"Multiple","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"6.6","keywords":["error","message"],"differentials":[],"test_case":"","architecture":"Multiple","cc":[""],"type":"Bug","description":"I've seen this error with GHC 6.6 on a PPC Mac (10.4.8), but I suspect it happens on multiple systems.\r\n\r\nConsider ''Main.hs''\r\n{{{\r\nmodule Main where\r\n\r\nimport Test\r\n\r\nmain = test\r\n}}}\r\n\r\nand ''Test.hs''\r\n{{{\r\nmmmodule Test where\r\n\r\ntest = putStr \"stutter\"\r\n}}}\r\n\r\nThe error message for trying to load the Main module is\r\n{{{\r\n$ ghci Main\r\n[snip]\r\nLoading package base ... linking ... done.\r\n\r\n<no location info>: file name does not match module name `Main'\r\nFailed, modules loaded: none.\r\nPrelude> \r\n}}}\r\n\r\nThis provides no information regarding the actual location of the error. In a program of a considerable number of modules, the offending module can be difficult to track down. Moreover, the error provides no direct indication that there's a source file without the module keyword in it.\r\n\r\nThe path of the offending file should be included in the error.","type_of_failure":"OtherFailure","blocking":[]} -->6.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>