summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Schmits <git@tryp.io>2022-07-19 16:57:53 +0200
committerTorsten Schmits <git@tryp.io>2022-07-19 16:57:53 +0200
commit9bb2edfb4cefc39c949581e5f85a3b4430730f6d (patch)
tree3cf332db2df5a8aef970776bd2977939289551bb
parenta0ff21d92392a6db469a7cc1576798d119bee805 (diff)
downloadhaskell-9bb2edfb4cefc39c949581e5f85a3b4430730f6d.tar.gz
add more tests
-rw-r--r--testsuite/tests/implicitforall/all.T2
-rw-r--r--testsuite/tests/implicitforall/no-ifa-data-fail.hs8
-rw-r--r--testsuite/tests/implicitforall/no-ifa-data-fail.stderr6
-rw-r--r--testsuite/tests/implicitforall/no-ifa-data.hs17
-rw-r--r--testsuite/tests/implicitforall/no-ifa-fun.hs7
5 files changed, 39 insertions, 1 deletions
diff --git a/testsuite/tests/implicitforall/all.T b/testsuite/tests/implicitforall/all.T
index 1f9ebd4a43..89905b01fb 100644
--- a/testsuite/tests/implicitforall/all.T
+++ b/testsuite/tests/implicitforall/all.T
@@ -1,5 +1,7 @@
test('ifa-fun', normal, compile, [''])
test('ifa-fun-fail', normal, compile_fail, [''])
test('ifa-data', normal, compile, [''])
+test('no-ifa-fun', normal, compile, [''])
test('no-ifa-fun-fail', normal, compile_fail, [''])
+test('no-ifa-data', normal, compile, [''])
test('no-ifa-data-fail', normal, compile_fail, [''])
diff --git a/testsuite/tests/implicitforall/no-ifa-data-fail.hs b/testsuite/tests/implicitforall/no-ifa-data-fail.hs
index 430a666325..996c72d636 100644
--- a/testsuite/tests/implicitforall/no-ifa-data-fail.hs
+++ b/testsuite/tests/implicitforall/no-ifa-data-fail.hs
@@ -1,4 +1,4 @@
-{-# language NoImplicitForAll #-}
+{-# language NoImplicitForAll, TypeFamilies #-}
module ShouldFail where
@@ -7,3 +7,9 @@ import Data.Kind (Type)
data Imp1 a :: b -> Type
data Imp2 a :: forall b . b -> c -> Type
+
+type family F a :: b
+
+data family DF a :: a
+
+data instance DF (Maybe a) :: Maybe a
diff --git a/testsuite/tests/implicitforall/no-ifa-data-fail.stderr b/testsuite/tests/implicitforall/no-ifa-data-fail.stderr
index 8878b33593..ebb3210a71 100644
--- a/testsuite/tests/implicitforall/no-ifa-data-fail.stderr
+++ b/testsuite/tests/implicitforall/no-ifa-data-fail.stderr
@@ -1,3 +1,9 @@
no-ifa-data-fail.hs:7:16: Not in scope: type variable ‘b’
no-ifa-data-fail.hs:9:32: Not in scope: type variable ‘c’
+
+no-ifa-data-fail.hs:11:20: Not in scope: type variable ‘b’
+
+no-ifa-data-fail.hs:15:25: Not in scope: type variable ‘a’
+
+no-ifa-data-fail.hs:15:37: Not in scope: type variable ‘a’
diff --git a/testsuite/tests/implicitforall/no-ifa-data.hs b/testsuite/tests/implicitforall/no-ifa-data.hs
new file mode 100644
index 0000000000..f65bdce4ba
--- /dev/null
+++ b/testsuite/tests/implicitforall/no-ifa-data.hs
@@ -0,0 +1,17 @@
+{-# language NoImplicitForAll, TypeFamilies #-}
+
+module ShouldCompile where
+
+import Data.Kind (Type)
+
+data family DF a :: a
+
+type D :: forall k . k -> Type
+data D a
+
+data DK (a :: k)
+
+type F2 :: forall k . Type -> k -> Type
+type family F2 a
+
+type instance F2 Int = D
diff --git a/testsuite/tests/implicitforall/no-ifa-fun.hs b/testsuite/tests/implicitforall/no-ifa-fun.hs
new file mode 100644
index 0000000000..676e4aa255
--- /dev/null
+++ b/testsuite/tests/implicitforall/no-ifa-fun.hs
@@ -0,0 +1,7 @@
+{-# language NoImplicitForAll #-}
+
+module ShouldCompile where
+
+h :: forall a . Int -> a -> a
+h (i :: b) =
+ undefined