diff options
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T12102b.hs | 21 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T12102b.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T12102b.hs b/testsuite/tests/typecheck/should_fail/T12102b.hs new file mode 100644 index 0000000000..8478059c8f --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12102b.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE TypeFamilies #-} +module T12102b where + +import Data.Kind +import GHC.TypeLits + +type family IsTypeLit a where + IsTypeLit Nat = 'True + IsTypeLit Symbol = 'True + IsTypeLit a = 'False + +data T :: forall a. (IsTypeLit a ~ 'True) => a -> Type where + MkNat :: T 42 + MkSymbol :: T "Don't panic!" + +deriving instance Show (T a) diff --git a/testsuite/tests/typecheck/should_fail/T12102b.stderr b/testsuite/tests/typecheck/should_fail/T12102b.stderr new file mode 100644 index 0000000000..d93b7fda9c --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12102b.stderr @@ -0,0 +1,7 @@ + +T12102b.hs:21:25: error: + • Couldn't match expected kind ‘'True’ + with actual kind ‘IsTypeLit a0’ + The type variable ‘a0’ is ambiguous + • In the first argument of ‘Show’, namely ‘(T a)’ + In the stand-alone deriving instance for ‘Show (T a)’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index d155ca0e8c..fec3a3ae67 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -411,6 +411,7 @@ test('T12083a', normal, compile_fail, ['']) test('T12083b', normal, compile_fail, ['']) test('T11974b', normal, compile_fail, ['']) test('T12102', normal, compile, ['']) +test('T12102b', normal, compile_fail, ['']) test('T12151', normal, compile_fail, ['']) test('T7437', normal, compile_fail, ['']) test('T12177', normal, compile_fail, ['']) |