diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/polykinds/T11203.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T11821a.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T17566.hs | 20 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T17566a.hs | 15 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T17566b.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T17566b.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T17566c.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T17566c.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 2 |
11 files changed, 75 insertions, 4 deletions
diff --git a/testsuite/tests/polykinds/T11203.stderr b/testsuite/tests/polykinds/T11203.stderr index f5c72133ae..e6f30c0335 100644 --- a/testsuite/tests/polykinds/T11203.stderr +++ b/testsuite/tests/polykinds/T11203.stderr @@ -1,4 +1,4 @@ T11203.hs:7:24: error: - • Couldn't match ‘k1’ with ‘k2’ - • In the data type declaration for ‘Q’ + • Different names for the same type variable: ‘k1’ and ‘k2’ + • In the data declaration for ‘Q’ diff --git a/testsuite/tests/polykinds/T11821a.stderr b/testsuite/tests/polykinds/T11821a.stderr index f55c703524..50d58df8f5 100644 --- a/testsuite/tests/polykinds/T11821a.stderr +++ b/testsuite/tests/polykinds/T11821a.stderr @@ -1,4 +1,4 @@ T11821a.hs:4:31: error: - • Couldn't match ‘k1’ with ‘k2’ - • In the type synonym declaration for ‘SameKind’ + • Different names for the same type variable: ‘k1’ and ‘k2’ + • In the type declaration for ‘SameKind’ diff --git a/testsuite/tests/typecheck/should_compile/Makefile b/testsuite/tests/typecheck/should_compile/Makefile index 5255485601..5c0c84f8ec 100644 --- a/testsuite/tests/typecheck/should_compile/Makefile +++ b/testsuite/tests/typecheck/should_compile/Makefile @@ -75,3 +75,8 @@ T14934: $(RM) -f T14934a.o T14934a.hi T14934.o T14934.hi '$(TEST_HC)' $(TEST_HC_OPTS) -c T14934a.hs -O '$(TEST_HC)' $(TEST_HC_OPTS) -c T14934.hs -O + +T17566: + $(RM) -f T17566a.o T17566a.hi T17566.o T17566.hi + '$(TEST_HC)' $(TEST_HC_OPTS) -c T17566a.hs + '$(TEST_HC)' $(TEST_HC_OPTS) -c T17566.hs diff --git a/testsuite/tests/typecheck/should_compile/T17566.hs b/testsuite/tests/typecheck/should_compile/T17566.hs new file mode 100644 index 0000000000..5996bd7d47 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T17566.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +module T17566 where + +import Data.Kind +import Data.Proxy +import T17566a + +type family F1 (x :: Proxy a) :: Proxy a +instance C1 Proxy z where + type T1 x = F1 x + data D1 x + +type family F2 (x :: Proxy a) :: Proxy a +instance C2 Proxy z where + type T2 x = F2 x + data D2 x diff --git a/testsuite/tests/typecheck/should_compile/T17566a.hs b/testsuite/tests/typecheck/should_compile/T17566a.hs new file mode 100644 index 0000000000..6255a7a7ba --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T17566a.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +module T17566a where + +import Data.Kind + +class C1 (f :: k -> Type) z where + type T1 (x :: f a) :: f a + data D1 (x :: f a) + +class C2 f z where + type T2 (x :: f a) :: f a + data D2 (x :: f a) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 80b11ca851..0f61b57faf 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -692,3 +692,4 @@ test('T17202', expect_broken(17202), compile, ['']) test('T15839a', normal, compile, ['']) test('T15839b', normal, compile, ['']) test('T17343', exit_code(1), compile_and_run, ['']) +test('T17566', [extra_files(['T17566a.hs'])], makefile_test, []) diff --git a/testsuite/tests/typecheck/should_fail/T17566b.hs b/testsuite/tests/typecheck/should_fail/T17566b.hs new file mode 100644 index 0000000000..7b1711ada6 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T17566b.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +module T17566b where + +class C f where + type T1 (f :: k1) + type T2 (f :: k2) diff --git a/testsuite/tests/typecheck/should_fail/T17566b.stderr b/testsuite/tests/typecheck/should_fail/T17566b.stderr new file mode 100644 index 0000000000..be3c0e19bd --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T17566b.stderr @@ -0,0 +1,4 @@ + +T17566b.hs:7:17: error: + • Different names for the same type variable: ‘k1’ and ‘k2’ + • In the class declaration for ‘C’ diff --git a/testsuite/tests/typecheck/should_fail/T17566c.hs b/testsuite/tests/typecheck/should_fail/T17566c.hs new file mode 100644 index 0000000000..d7d68a050c --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T17566c.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +module T17566c where + +import Data.Kind + +class C2 f z where + type T2 (f :: k -> Type) + data D2 (x :: (f :: k -> Type) a) diff --git a/testsuite/tests/typecheck/should_fail/T17566c.stderr b/testsuite/tests/typecheck/should_fail/T17566c.stderr new file mode 100644 index 0000000000..df5e5c0739 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T17566c.stderr @@ -0,0 +1,6 @@ + +T17566c.hs:11:23: error: + • Different names for the same type variable: + ‘k’ bound at T17566c.hs:10:17 + ‘k’ bound at T17566c.hs:11:23 + • In the class declaration for ‘C2’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index e11c239742..f0f290c405 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -550,3 +550,5 @@ test('T17355', normal, compile_fail, ['']) test('T17360', normal, compile_fail, ['']) test('T17563', normal, compile_fail, ['']) test('T16946', normal, compile_fail, ['']) +test('T17566b', normal, compile_fail, ['']) +test('T17566c', normal, compile_fail, ['']) |