No error message in explicit import containing unused and undefined constructor (Regression)
Helper file:
module A where
data X = Foo
Reproduction:
module B where
import A (X (X))
f :: X
f = undefined
Result (GHC 7.8.3):
$ ghc -Wall B.hs
[1 of 2] Compiling A ( A.hs, nothing )
[2 of 2] Compiling B ( B.hs, nothing )
$
Result (GHC 7.6.3):
$ ghc -Wall B.hs
[1 of 2] Compiling A ( A.hs, nothing )
[2 of 2] Compiling B ( B.hs, nothing )
B.hs:3:11: Module `A' does not export `X(X)'
$
I tested other combinations and this regression seems to only occur when using an explicit import list and specifying an undefined constructor with the same name as the type. If you try to use the undefined constructor you will get an error at the use site instead of the import site.
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |