[GHC] #11637: single-module recursion and import aliases

GHC ghc-devs at haskell.org
Wed Feb 24 17:58:42 UTC 2016


#11637: single-module recursion and import aliases
-------------------------------------+-------------------------------------
           Reporter:  dmwit          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I put the following code in {{{Foo.hs}}}:

 {{{
 module Foo where
 import Prelude (Either(..))
 import {-# SOURCE #-} Foo as F
 not (Left x) = x
 not (Right x) = F.not (Left x)
 }}}

 And the following code in {{{Foo.hs-boot}}}:

 {{{
 module Foo where
 import Prelude(Either)
 not :: Either a a -> a
 }}}

 I get the following error when trying to compile:

 {{{
 % ghc -c Foo.hs-boot
 % ghc -c Foo.hs

 Foo.hs:5:17: Not in scope: ‘F.not’
 zsh: exit 1     ghc -c Foo.hs
 }}}

 This surprises me, as running ghci on a slightly modified version
 (replacing {{{F.not (Left x)}}} with simply {{{x}}}) confirms that `not`
 is exported correctly; hence I believe {{{F.not}}} should indeed be in
 scope.

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


More information about the ghc-tickets mailing list