#7347: Existential data constructors should not be promoted
---------------------------------+------------------------------------------
    Reporter:  simonpj           |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.6.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
 Stefan Holdermans reports: I am almost sure this is a known issue, but I
 noticed some erroneous (?) interaction between datatype promotion and
 existential quantification. Consider the following program:
 {{{
   {-# LANGUAGE DataKinds                 #-}
   {-# LANGUAGE ExistentialQuantification #-}
   {-# LANGUAGE GADTs                     #-}
   {-# LANGUAGE KindSignatures            #-}

   module Test where

   data K = forall a. T a  -- promotion gives 'T :: * -> K

   data G :: K -> * where
     D :: G (T [])         -- kind error!
 }}}
 I would expect the type checker to reject it, but GHC (version 7.6.1)
 compiles it happily

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to