diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-02-19 18:27:09 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-02-21 04:26:15 -0500 |
commit | 2f4af71e73ac3b59f4faba5bf1b25774b1008898 (patch) | |
tree | 2f3db562b6ff0609be9207276921bafc2a6c620f /testsuite/tests/parser | |
parent | 32f44ed81b0f16099d780e73ad2ea1a3cd812448 (diff) | |
download | haskell-2f4af71e73ac3b59f4faba5bf1b25774b1008898.tar.gz |
Dot/bang operators in export lists (Trac #16339)
The dot type operator was handled in the 'tyvarop' parser production, and the
bang type operator in 'tyapp'. However, export lists and role annotations use
'oqtycon', so these type operators could not be exported or assigned roles.
The fix is to handle them in a lower level production, 'tyconsym'.
Diffstat (limited to 'testsuite/tests/parser')
-rw-r--r-- | testsuite/tests/parser/should_compile/T16339.hs | 18 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/all.T | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/T16339.hs b/testsuite/tests/parser/should_compile/T16339.hs new file mode 100644 index 0000000000..9bb8349ad4 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T16339.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE ExplicitNamespaces, TypeOperators, RoleAnnotations #-} +{-# OPTIONS -Wno-duplicate-exports #-} + +module T16339 + ( + type (!), + type (!)(Bang), + type (!)(..), + type (.), + type (.)(Dot), + type (.)(..), + ) where + +data a ! b = Bang +data f . g = Dot + +type role (!) phantom phantom +type role (.) phantom phantom diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index b3f693d783..1c5c225d65 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -141,3 +141,4 @@ test('T15279', normalise_errmsg_fun(only_MG_loc), compile, ['']) test('T15457', normal, compile, ['']) test('T15675', normal, compile, ['']) test('T15781', normal, compile, ['']) +test('T16339', normal, compile, ['']) |