[GHC] #9544: No error message in explicit import containing unused and undefined constructor (Regression)

GHC ghc-devs at haskell.org
Wed Sep 3 15:20:09 UTC 2014


#9544: No error message in explicit import containing unused and undefined
constructor (Regression)
-------------------------------------+-------------------------------------
       Reporter:  bergmark           |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:  GHC
     Blocked By:                     |  accepts invalid program
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 Helper file:
 {{{#!hs
 module A where

 data X = Foo
 }}}

 Reproduction:
 {{{#!hs
 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.

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


More information about the ghc-tickets mailing list