diff options
Diffstat (limited to 'testsuite/tests/dependent/should_fail')
7 files changed, 28 insertions, 7 deletions
diff --git a/testsuite/tests/dependent/should_fail/BadTelescope2.hs b/testsuite/tests/dependent/should_fail/BadTelescope2.hs index b12adbd8e3..e33fdf110e 100644 --- a/testsuite/tests/dependent/should_fail/BadTelescope2.hs +++ b/testsuite/tests/dependent/should_fail/BadTelescope2.hs @@ -10,5 +10,5 @@ data SameKind :: k -> k -> * foo :: forall a k (b :: k). SameKind a b foo = undefined -bar :: forall a (c :: Proxy b) (d :: Proxy a). Proxy c -> SameKind b d +bar :: forall a k (b :: k) (c :: Proxy b) (d :: Proxy a). Proxy c -> SameKind b d bar = undefined diff --git a/testsuite/tests/dependent/should_fail/BadTelescope2.stderr b/testsuite/tests/dependent/should_fail/BadTelescope2.stderr index 55a484910c..a8c4b689ae 100644 --- a/testsuite/tests/dependent/should_fail/BadTelescope2.stderr +++ b/testsuite/tests/dependent/should_fail/BadTelescope2.stderr @@ -5,9 +5,9 @@ BadTelescope2.hs:10:8: error: k (a :: k) (b :: k) • In the type signature: foo :: forall a k (b :: k). SameKind a b -BadTelescope2.hs:13:70: error: - • Expected kind ‘k0’, but ‘d’ has kind ‘Proxy a’ +BadTelescope2.hs:13:81: error: + • Expected kind ‘k’, but ‘d’ has kind ‘Proxy a’ • In the second argument of ‘SameKind’, namely ‘d’ In the type signature: - bar :: forall a (c :: Proxy b) (d :: Proxy a). + bar :: forall a k (b :: k) (c :: Proxy b) (d :: Proxy a). Proxy c -> SameKind b d diff --git a/testsuite/tests/dependent/should_fail/T15264.hs b/testsuite/tests/dependent/should_fail/T15264.hs new file mode 100644 index 0000000000..394c53a013 --- /dev/null +++ b/testsuite/tests/dependent/should_fail/T15264.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE ExplicitForAll, PolyKinds #-} + +module T15264 where + +import Data.Proxy + +bad1 :: forall (a :: k). Proxy a -> () +bad1 _ = () + +bad2 :: forall (a :: k1) (b :: k2). Proxy a -> () +bad2 _ = () + +good :: forall k (a :: k). Proxy a -> () +good _ = () diff --git a/testsuite/tests/dependent/should_fail/T15264.stderr b/testsuite/tests/dependent/should_fail/T15264.stderr new file mode 100644 index 0000000000..6d5f597823 --- /dev/null +++ b/testsuite/tests/dependent/should_fail/T15264.stderr @@ -0,0 +1,6 @@ + +T15264.hs:7:22: error: Not in scope: type variable ‘k’ + +T15264.hs:10:22: error: Not in scope: type variable ‘k1’ + +T15264.hs:10:32: error: Not in scope: type variable ‘k2’ diff --git a/testsuite/tests/dependent/should_fail/T15825.hs b/testsuite/tests/dependent/should_fail/T15825.hs index 01227a8696..651525b21d 100644 --- a/testsuite/tests/dependent/should_fail/T15825.hs +++ b/testsuite/tests/dependent/should_fail/T15825.hs @@ -10,5 +10,5 @@ module T15825 where type C k = (forall (x::k). *) -class X (a :: *) -instance forall (a :: C k). X (a :: *) +class X (a :: *) +instance forall k (a :: C k). X (a :: *) diff --git a/testsuite/tests/dependent/should_fail/T15825.stderr b/testsuite/tests/dependent/should_fail/T15825.stderr index d64cab0494..97582ba952 100644 --- a/testsuite/tests/dependent/should_fail/T15825.stderr +++ b/testsuite/tests/dependent/should_fail/T15825.stderr @@ -1,5 +1,5 @@ -T15825.hs:14:29: error: +T15825.hs:14:31: error: • Illegal type synonym family application ‘GHC.Types.Any @k’ in instance: X (a @(GHC.Types.Any @k)) diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T index f1272200ba..4b258cc065 100644 --- a/testsuite/tests/dependent/should_fail/all.T +++ b/testsuite/tests/dependent/should_fail/all.T @@ -39,3 +39,4 @@ test('T15743c', normal, compile_fail, ['']) test('T15743d', normal, compile_fail, ['']) test('T15825', normal, compile_fail, ['']) test('T15859', normal, compile_fail, ['']) +test('T15264', normal, compile_fail, ['']) |