diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15862.hs | 36 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15862.stderr | 28 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 65 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T15862.hs b/testsuite/tests/typecheck/should_fail/T15862.hs new file mode 100644 index 0000000000..c98b5939d1 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15862.hs @@ -0,0 +1,36 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE ImpredicativeTypes #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE UnboxedSums #-} +module Bug where + +import Data.Kind +import Type.Reflection + +newtype Foo = MkFoo (forall a. a) + +foo :: TypeRep MkFoo +foo = typeRep @MkFoo + +type family F a +type instance F Int = Type + +data Bar = forall (a :: F Int). MkBar a + +bar :: TypeRep (MkBar True) +bar = typeRep + +data Quux = MkQuux (# Bool | Int #) + +quux :: TypeRep MkQuux +quux = typeRep + +data Quuz :: (Type ~ Type) => Type where + MkQuuz :: Quuz + +quuz :: TypeRep MkQuuz +quuz = typeRep diff --git a/testsuite/tests/typecheck/should_fail/T15862.stderr b/testsuite/tests/typecheck/should_fail/T15862.stderr new file mode 100644 index 0000000000..97fbfab166 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15862.stderr @@ -0,0 +1,28 @@ + +T15862.hs:17:7: error: + • No instance for (Typeable 'MkFoo) arising from a use of ‘typeRep’ + GHC can't yet do polykinded + Typeable ('MkFoo :: (forall a. a) -> Foo) + • In the expression: typeRep @MkFoo + In an equation for ‘foo’: foo = typeRep @MkFoo + +T15862.hs:25:7: error: + • No instance for (Typeable 'MkBar) arising from a use of ‘typeRep’ + GHC can't yet do polykinded Typeable ('MkBar :: Bool -> Bar) + • In the expression: typeRep + In an equation for ‘bar’: bar = typeRep + +T15862.hs:30:8: error: + • No instance for (Typeable 'MkQuux) + arising from a use of ‘typeRep’ + GHC can't yet do polykinded + Typeable ('MkQuux :: (# Bool | Int #) -> Quux) + • In the expression: typeRep + In an equation for ‘quux’: quux = typeRep + +T15862.hs:36:8: error: + • No instance for (Typeable 'MkQuuz) + arising from a use of ‘typeRep’ + GHC can't yet do polykinded Typeable ('MkQuuz :: Quuz) + • In the expression: typeRep + In an equation for ‘quuz’: quuz = typeRep diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 7ee15ebc4c..0b0ae59391 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -503,6 +503,7 @@ test('T15797', normal, compile_fail, ['']) test('T15799', normal, compile_fail, ['']) test('T15801', normal, compile_fail, ['']) test('T15816', normal, compile_fail, ['']) +test('T15862', normal, compile_fail, ['']) test('T16059a', normal, compile_fail, ['']) test('T16059c', [extra_files(['T16059b.hs'])], multimod_compile_fail, ['T16059c', '-v0']) |