Add a regression test for #14548 wip/14548
authorVladislav Zavialov <vlad.z.4096@gmail.com>
Tue, 7 May 2019 15:17:44 +0000 (18:17 +0300)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Wed, 8 May 2019 20:05:52 +0000 (16:05 -0400)
testsuite/tests/rename/should_fail/T14548.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/T14548.stderr [new file with mode: 0644]
testsuite/tests/rename/should_fail/all.T

diff --git a/testsuite/tests/rename/should_fail/T14548.hs b/testsuite/tests/rename/should_fail/T14548.hs
new file mode 100644 (file)
index 0000000..0a7ea5b
--- /dev/null
@@ -0,0 +1,17 @@
+{-# LANGUAGE ScopedTypeVariables, TypeApplications, PolyKinds #-}
+
+module T14548 where
+
+data Prox (a :: k) = MkProx
+
+-- fail
+f :: forall a. Prox (a :: k)
+f = MkProx @k @a
+
+-- fail
+g :: forall (a :: k). Prox (a :: k)
+g = MkProx @k @a
+
+-- ok
+h :: forall k (a :: k). Prox (a :: k)
+h = MkProx @k @a
diff --git a/testsuite/tests/rename/should_fail/T14548.stderr b/testsuite/tests/rename/should_fail/T14548.stderr
new file mode 100644 (file)
index 0000000..3527ac4
--- /dev/null
@@ -0,0 +1,10 @@
+
+T14548.hs:8:27: error: Not in scope: type variable ‘k’
+
+T14548.hs:9:13: error: Not in scope: type variable ‘k’
+
+T14548.hs:12:19: error: Not in scope: type variable ‘k’
+
+T14548.hs:12:34: error: Not in scope: type variable ‘k’
+
+T14548.hs:13:13: error: Not in scope: type variable ‘k’
index 52a4f45..28f9790 100644 (file)
@@ -149,3 +149,4 @@ test('ExplicitForAllRules2', normal, compile_fail, [''])
 test('T15957_Fail', normal, compile_fail, ['-Werror -Wall -Wno-missing-signatures'])
 test('T16385', normal, compile_fail, [''])
 test('T16504', normal, compile_fail, [''])
+test('T14548', normal, compile_fail, [''])