Skip to content

"Ambiguos occurrence" error message uses strange qualification

The following text produces an error message that I find somewhat confusing. This issue is just about the wording of the message.

module A (null) where { }
module B where { import qualified A ; null = 42 ; main = null }

when I load B in ghci, I get

B.hs:1:58: error:
    Ambiguous occurrence ‘null’
    It could refer to either ‘A.null’,
                             imported from ‘Prelude’ at B.hs:1:8
                             (and originally defined in ‘Data.Foldable’)
                          or ‘B.null’, defined at B.hs:1:39

I think ".. could refer to A.null" looks strange. I would expect Prelude.null here, which I do get when I remove "import qualified A" from the text of B.

Trac metadata
Trac field Value
Version 8.4.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information