[GHC] #10341: hs-boot files can have bogus declarations if they're not exported

GHC ghc-devs at haskell.org
Wed Apr 22 11:07:03 UTC 2015


#10341: hs-boot files can have bogus declarations if they're not exported
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  low               |               Milestone:
       Component:  Compiler (Type    |                 Version:  7.11
  checker)                           |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  GHC accepts       |               Test Case:
  invalid program                    |                Blocking:
      Blocked By:                    |  Differential Revisions:
 Related Tickets:                    |
-------------------------------------+-------------------------------------
Description changed by simonpj:

Old description:

> Consider:
>
> {{{
> -- A.hs-boot
> module A(foo) where
> data A  = AC { bar :: Int } | CC
> -- B.hs
> module B where
> import {-# SOURCE #-} A
> -- A.hs
> module A(foo) where
> import B
> data A = AC { foo :: Int } | BC
> }}}
>
> GHC won't complain that `A` is incompatibly defined, since it's not
> exported.
>
> Seems relatively harmless though.

New description:

 Consider:

 {{{
 -- A.hs-boot
 module A(foo) where
   foo :: A -> Int
   data A  = AC { bar :: Int } | CC
    -- NB: A is not exported

 -- B.hs
 module B where
   import {-# SOURCE #-} A

 -- A.hs
 module A(foo) where
   import B
   data A = AC { foo :: Int } | BC
 }}}

 GHC won't complain that `A` is incompatibly defined, since it's not
 exported.

 Seems relatively harmless though.

--

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


More information about the ghc-tickets mailing list