summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci/scripts/T19158.script3
-rw-r--r--testsuite/tests/ghci/scripts/T19158.stderr6
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T2
-rw-r--r--testsuite/tests/typecheck/should_fail/T19142.hs20
-rw-r--r--testsuite/tests/typecheck/should_fail/T19142.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
6 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T19158.script b/testsuite/tests/ghci/scripts/T19158.script
new file mode 100644
index 0000000000..81d392cf43
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T19158.script
@@ -0,0 +1,3 @@
+:set -fdefer-type-errors
+:set -XTypeApplications
+:t id @Maybe
diff --git a/testsuite/tests/ghci/scripts/T19158.stderr b/testsuite/tests/ghci/scripts/T19158.stderr
new file mode 100644
index 0000000000..9b15a102e8
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T19158.stderr
@@ -0,0 +1,6 @@
+
+<interactive>:1:5: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type ‘Maybe’
+ In the expression: id @Maybe
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index f5c1a4ca39..08a6c4ee6a 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -327,3 +327,5 @@ test('T18644', normal, ghci_script, ['T18644.script'])
test('T18755', normal, ghci_script, ['T18755.script'])
test('T18828', normal, ghci_script, ['T18828.script'])
test('T19197', normal, ghci_script, ['T19197.script'])
+test('T19158', normal, ghci_script, ['T19158.script'])
+
diff --git a/testsuite/tests/typecheck/should_fail/T19142.hs b/testsuite/tests/typecheck/should_fail/T19142.hs
new file mode 100644
index 0000000000..6c49498efa
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T19142.hs
@@ -0,0 +1,20 @@
+{-# OPTIONS_GHC -fdefer-type-errors #-}
+{-# LANGUAGE ExplicitForAll
+ , TypeApplications
+ , KindSignatures
+ , ScopedTypeVariables
+#-}
+
+module T19142 where
+
+-- Both these examples gave Lint errors
+-- NB: the -fdefer-type-errors at the top!!
+
+-- Example 1
+f (x :: Maybe Maybe) = x
+
+-- Example 2
+foo :: forall (f :: * -> *) . String
+foo = ""
+
+g x = foo @Int
diff --git a/testsuite/tests/typecheck/should_fail/T19142.stderr b/testsuite/tests/typecheck/should_fail/T19142.stderr
new file mode 100644
index 0000000000..fc94a4166f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T19142.stderr
@@ -0,0 +1,13 @@
+
+T19142.hs:14:15: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the first argument of ‘Maybe’, namely ‘Maybe’
+ In the type ‘Maybe Maybe’
+ In a pattern type signature: Maybe Maybe
+
+T19142.hs:20:12: error:
+ • Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
+ • In the type ‘Int’
+ In the expression: foo @Int
+ In an equation for ‘g’: g x = foo @Int
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 76f99f81c6..e191a736aa 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -612,3 +612,4 @@ test('TyAppPat_ScopedTyVarConflict', normal, compile_fail, [''])
test('TyAppPat_TooMany', normal, compile_fail, [''])
test('T12178a', normal, compile_fail, [''])
test('T18869', normal, compile_fail, [''])
+test('T19142', normal, compile_fail, [''])