diff options
author | Thomas Winant <thomas.winant@cs.kuleuven.be> | 2014-12-15 09:47:07 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-12-15 09:47:07 -0600 |
commit | 48222831ae392cb556707b6b290a4dcc2677d97b (patch) | |
tree | 39ad95d76445d264fdaa7841ba0baed5c4234540 /testsuite/tests/partial-sigs | |
parent | bd0f9e1fad6ab69b5967247b32fd8f9305b064a5 (diff) | |
download | haskell-48222831ae392cb556707b6b290a4dcc2677d97b.tar.gz |
Fix panic on [t| _ |] (Trac #9879)
Summary:
Type brackets containing a wildcard, e.g. `[t| _ |]`, caused a panic.
Fix it by disallowing wildcards in type brackets.
Together with D572, this fixes #9879.
Test Plan: new test WildcardInTypeBrackets should pass
Reviewers: austin
Reviewed By: austin
Subscribers: carter, thomie, monoidal
Differential Revision: https://phabricator.haskell.org/D573
GHC Trac Issues: #9879
Diffstat (limited to 'testsuite/tests/partial-sigs')
3 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInTypeBrackets.hs b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeBrackets.hs new file mode 100644 index 0000000000..f11ac5a9f1 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeBrackets.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE TemplateHaskell #-} +module WildcardInTypeBrackets where + +foo = [t| _ |] diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInTypeBrackets.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeBrackets.stderr new file mode 100644 index 0000000000..dd6feb9cef --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeBrackets.stderr @@ -0,0 +1,4 @@ + +WildcardInTypeBrackets.hs:4:11: + Wildcard not allowed + in type brackets: ‘[t| _ |]’ diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T index ef08d3721b..c275e93b7f 100644 --- a/testsuite/tests/partial-sigs/should_fail/all.T +++ b/testsuite/tests/partial-sigs/should_fail/all.T @@ -36,6 +36,7 @@ test('WildcardsInPatternAndExprSig', normal, compile_fail, ['']) test('WildcardInPatSynSig', normal, compile_fail, ['']) test('WildcardInNewtype', normal, compile_fail, ['']) test('WildcardInstantiations', normal, compile_fail, ['']) +test('WildcardInTypeBrackets', [req_interp, only_compiler_types(['ghc'])], compile_fail, ['']) test('WildcardInTypeFamilyInstanceLHS', normal, compile_fail, ['']) test('WildcardInTypeFamilyInstanceRHS', normal, compile_fail, ['']) test('WildcardInTypeSynonymLHS', normal, compile_fail, ['']) |