diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-11-25 14:31:33 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-11-25 16:33:21 +0000 |
commit | c1b4b76931a58c59e5b269477e38db659cf7aea8 (patch) | |
tree | eecdff6435d801430b3c5d4ecbd9536729375831 /testsuite | |
parent | e31946600b0c4ecfb88eaa64fa2aeebf9194a809 (diff) | |
download | haskell-c1b4b76931a58c59e5b269477e38db659cf7aea8.tar.gz |
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.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/rename/should_fail/T12686.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/T12686.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/rename/should_fail/all.T | 1 |
3 files changed, 18 insertions, 0 deletions
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, ['']) |