goldfirere / ghc

Mirror of ghc repository. DO NOT SUBMIT PULL REQUESTS HERE
http://www.haskell.org/ghc/
Other
25 stars 1 forks source link

Unpack lifted equalities for use in types #57

Open goldfirere opened 8 years ago

goldfirere commented 8 years ago

The following should compile, but doesn't.

{-# LANGUAGE PolyKinds, MultiParamTypeClasses, GADTs, ScopedTypeVariables,
             TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}

module Super where

import Data.Proxy
import GHC.Prim

class (a ~ b) => C a b
data SameKind :: k -> k -> * where
  SK :: SameKind a b

bar :: forall (a :: *) (b :: *). C a b => Proxy a -> Proxy b -> ()
bar _ _ = const () (undefined :: forall (x :: a) (y :: b). SameKind x y)