Commit 07f378ce authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Marge Bot

Add tests for Trac #16221 and #16342

parent f624dc15
{-# LANGUAGE GADTs, TypeInType, ExistentialQuantification #-}
module T16221 where
-- Failed Lint
data T3 a = forall k (b :: k). MkT3 (T3 b) !Int
-- Works with GADT
data T4 a where
MkT4 :: T4 b -> !Int -> T4 a
-- Works with CUSK
data T5 (a :: j) = forall k (b :: k). MkT5 (T5 b) !Int
{-# LANGUAGE TypeInType, ExistentialQuantification #-}
module T16221a where
data SameKind :: k -> k -> *
data T2 a = forall k (b :: k). MkT2 (SameKind a b) !Int
T16221a.hs:6:49: error:
• Expected kind ‘k1’, but ‘b’ has kind ‘k’
• In the second argument of ‘SameKind’, namely ‘b’
In the type ‘(SameKind a b)’
In the definition of data constructor ‘MkT2’
{-# LANGUAGE MultiParamTypeClasses, TypeInType, ConstrainedClassMethods, ScopedTypeVariables #-}
module T16342 where
import Data.Proxy
class C (a::ka) x where
cop :: D a x => x -> Proxy a -> Proxy a
cop _ x = x :: Proxy (a::ka)
class D (b::kb) y where
dop :: C b y => y -> Proxy b -> Proxy b
dop _ x = x :: Proxy (b::kb)
......@@ -207,3 +207,6 @@ test('T14847', normal, compile, [''])
test('T15795', normal, compile, [''])
test('T15795a', normal, compile, [''])
test('KindVarOrder', normal, ghci_script, ['KindVarOrder.script'])
test('T16221', normal, compile, [''])
test('T16221a', normal, compile_fail, [''])
test('T16342', normal, compile, [''])
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment