From c1b4b76931a58c59e5b269477e38db659cf7aea8 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Fri, 25 Nov 2016 14:31:33 +0000 Subject: Fix a name-space problem with promotion Trac #12686 showed that we were allowing a term variable into a type, by promotion. I chose to squash this in the renamer. --- testsuite/tests/rename/should_fail/T12686.hs | 13 +++++++++++++ testsuite/tests/rename/should_fail/T12686.stderr | 4 ++++ testsuite/tests/rename/should_fail/all.T | 1 + 3 files changed, 18 insertions(+) create mode 100644 testsuite/tests/rename/should_fail/T12686.hs create mode 100644 testsuite/tests/rename/should_fail/T12686.stderr (limited to 'testsuite') diff --git a/testsuite/tests/rename/should_fail/T12686.hs b/testsuite/tests/rename/should_fail/T12686.hs new file mode 100644 index 0000000000..5d652f9c57 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T12686.hs @@ -0,0 +1,13 @@ +module T12686 where + +import Data.Proxy + +x = True + +data Bad = Bad 'x +-- The 'x should be rejeted in a civilised way + +data AlsoBad = AlsoBad { + a :: Int, + b :: Either Int 'a } +-- Ditto 'a here diff --git a/testsuite/tests/rename/should_fail/T12686.stderr b/testsuite/tests/rename/should_fail/T12686.stderr new file mode 100644 index 0000000000..24acc9c8c1 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T12686.stderr @@ -0,0 +1,4 @@ + +T12686.hs:7:16: error: Illegal promoted term variable in a type: x + +T12686.hs:12:19: error: Illegal promoted term variable in a type: a diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index f956bde8f4..b8c1ac51e5 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -141,3 +141,4 @@ test('T11071a', normal, compile_fail, ['']) test('T11663', normal, compile_fail, ['']) test('T12229', normal, compile, ['']) test('T12681', normal, multimod_compile_fail, ['T12681','-v0']) +test('T12686', normal, compile_fail, ['']) -- cgit v1.2.1