#5713: Non-backward compatible scoping-change for associated types in GHC-7.4
---------------------------------------+------------------------------------
 Reporter:  hvr                        |          Owner:                  
     Type:  bug                        |         Status:  new             
 Priority:  normal                     |      Component:  Compiler        
  Version:  7.3                        |       Keywords:                  
       Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple
  Failure:  GHC rejects valid program  |       Testcase:                  
Blockedby:                             |       Blocking:                  
  Related:                             |  
---------------------------------------+------------------------------------
 In GHC 7.4.0.20111218 I just noticed, that the scoping for associated
 types has changed. As I'm not sure whether this is a regression or was
 changed on purpose (couldn't find any mention of it in the current release
 notes), I've filed this as a bug for the mean time...


 {{{
 #!hs
 {-# LANGUAGE TypeFamilies #-}

 module ModB where

 class Foo a where
     type FooType
 }}}

 {{{
 #!hs
 {-# LANGUAGE TypeFamilies #-}

 module ModA where

 import qualified ModB

 -- works only with GHC-7.4
 -- error in GHC 7.2: "Not in scope: type constructor or class `FooType'"
 instance ModB.Foo Int where
     type FooType = Int

 -- works with GHC-7.0 and GHC-7.2, but NOT with GHC-7.4
 -- error in GHC-7.4: "Qualified name in binding position: ModB.FooType"
 instance ModB.Foo Char where
     type ModB.FooType = Char
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to