From 396e01b472bba36530e7eb065b82d311f0da7880 Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov <vlad.z.4096@gmail.com> Date: Tue, 7 May 2019 18:17:44 +0300 Subject: [PATCH] Add a regression test for #14548 --- testsuite/tests/rename/should_fail/T14548.hs | 17 +++++++++++++++++ .../tests/rename/should_fail/T14548.stderr | 10 ++++++++++ testsuite/tests/rename/should_fail/all.T | 1 + 3 files changed, 28 insertions(+) create mode 100644 testsuite/tests/rename/should_fail/T14548.hs create mode 100644 testsuite/tests/rename/should_fail/T14548.stderr diff --git a/testsuite/tests/rename/should_fail/T14548.hs b/testsuite/tests/rename/should_fail/T14548.hs new file mode 100644 index 0000000000..0a7ea5bc63 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14548.hs @@ -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 index 0000000000..3527ac4d63 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14548.stderr @@ -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’ diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index 52a4f45a04..28f97909c1 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -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, ['']) -- GitLab