#5661: Wrong error message on attempted import of undefined record field
---------------------------------+------------------------------------------
    Reporter:  YitzGale          |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.2             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 Test case:

 A.hs:
 {{{
 module A where
 data AData = AData {right :: ()}
 }}}

 B.hs:
 {{{
 module B where
 import A (AData(wrong))
 }}}

 What happens (7.0.2 on Linux):
 {{{
 $ ghc --make B
 [1 of 2] Compiling A                ( A.hs, A.o )
 [2 of 2] Compiling B                ( B.hs, B.o )

 B.hs:2:11:
     In module `A':
       `AData' is a data constructor of `AData'
     To import it use
       `import A (AData (AData))'
     or
       `import A (AData (..))'
 }}}

 It is clear from the syntax of the `import`
 that `AData` is referring to the type, not
 the constructor. The actual problem is that the
 field name is undefined.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5661>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to