diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2018-07-16 18:46:52 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-07-16 18:46:53 -0400 |
commit | 65c186f0fdde95fd7c63ab9bd9b33a0213dba7d1 (patch) | |
tree | 92abe9e3aeab1711db0e77361c453ee49f48ef55 /testsuite/tests/warnings | |
parent | 7fe4993673e43e5b21f38d79ecc8b5163e97ee84 (diff) | |
download | haskell-65c186f0fdde95fd7c63ab9bd9b33a0213dba7d1.tar.gz |
Do not imply NoStarIsType by TypeOperators/TypeInType
Implementation of the "Embrace TypeInType" proposal was done according
to the spec, which specified that TypeOperators must imply NoStarIsType.
This implication was meant to prevent breakage and to be removed in 2
releases. However, compiling head.hackage has shown that this
implication only magnified the breakage, so there is no reason to have
it in the first place.
To remain in compliance with the three-release policy, we add a
workaround to define the (*) type operator even when -XStarIsType is on.
Test Plan: ./validate
Reviewers: bgamari, RyanGlScott, goldfire, phadej, hvr
Reviewed By: bgamari, RyanGlScott
Subscribers: harpocrates, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4865
Diffstat (limited to 'testsuite/tests/warnings')
-rw-r--r-- | testsuite/tests/warnings/should_compile/StarBinder.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/warnings/should_compile/StarBinder.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/warnings/should_compile/all.T | 2 |
3 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_compile/StarBinder.hs b/testsuite/tests/warnings/should_compile/StarBinder.hs new file mode 100644 index 0000000000..09f51684ac --- /dev/null +++ b/testsuite/tests/warnings/should_compile/StarBinder.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeOperators, TypeFamilies #-} + +module X (type (X.*)) where + +type family (*) a b where { (*) a b = Either b a } diff --git a/testsuite/tests/warnings/should_compile/StarBinder.stderr b/testsuite/tests/warnings/should_compile/StarBinder.stderr new file mode 100644 index 0000000000..2dbcf0e800 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/StarBinder.stderr @@ -0,0 +1,10 @@ + +StarBinder.hs:5:14: warning: [-Wstar-binder (in -Wdefault)] + Found binding occurrence of ‘*’ yet StarIsType is enabled. + NB. To use (or export) this operator in modules with StarIsType, + including the definition module, you must qualify it. + +StarBinder.hs:5:30: warning: [-Wstar-binder (in -Wdefault)] + Found binding occurrence of ‘*’ yet StarIsType is enabled. + NB. To use (or export) this operator in modules with StarIsType, + including the definition module, you must qualify it. diff --git a/testsuite/tests/warnings/should_compile/all.T b/testsuite/tests/warnings/should_compile/all.T index 6740990853..fd2ba85035 100644 --- a/testsuite/tests/warnings/should_compile/all.T +++ b/testsuite/tests/warnings/should_compile/all.T @@ -20,3 +20,5 @@ test('Werror01', normal, compile, ['']) test('Werror02', normal, compile, ['']) test('MissingMod', normal, multimod_compile, ['MissingMod', '-Wmissing-home-modules']) + +test('StarBinder', normal, compile, [''])
\ No newline at end of file |