[GHC] #12488: Explicit namespaces doesn't enforce namespaces

GHC ghc-devs at haskell.org
Sat Aug 13 16:45:10 UTC 2016


#12488: Explicit namespaces doesn't enforce namespaces
-------------------------------------+-------------------------------------
           Reporter:  mpickering     |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:  newcomer       |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 It seems to me that the type keyword should permanently enforce that a
 RdrName lives in a particular namespace. Currently it only acts as a
 syntactic marker so that type constructors which looks like variables can
 be included in export lists.

 The following example is accepted by GHC. As `A` is parsed as a type
 constructor but later put into the data constructor namespace.

 {{{#!hs
 {-# LANGUAGE ExplicitNamespaces #-}
 {-# LANGUAGE TypeFamilies #-}
 module M ( T (type A) ) where

 data T = A

 class Foo a where
   type A a
   foo :: a -> Int
 }}}

 The fix is to track uses of ExplicitNamespaces in the AST and then use
 this information in the renamer.

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


More information about the ghc-tickets mailing list