[GHC] #13321: Importing a bundled pattern "infects" all other imports of that pattern

GHC ghc-devs at haskell.org
Thu Feb 23 21:39:23 UTC 2017


#13321: Importing a bundled pattern "infects" all other imports of that pattern
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ezyang):

 Yes, rwbarton is exactly right. Here's a self-contained example that
 doesn't involve looking at the interface file:

 {{{
 {-# LANGUAGE PatternSynonyms #-}
 unit p where
     module A0 where
         data G = G Int
     module A1 where
         import A0
         pattern X x = G x
     module A(G(X)) where
         import A0
         import A1
     module B(G) where
         import A
     module C(pattern X) where
         import A
     module D(N.G, pattern N.X) where
         import B
         import C
         import qualified A0 as N
         import qualified A1 as N
     module E where
         import D(G(..))
         f (X x) = x -- X is in scope
 }}}

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


More information about the ghc-tickets mailing list