diff options
author | Ulya Trofimovich <skvadrik@gmail.com> | 2016-02-16 22:41:50 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-02-16 22:42:04 +0100 |
commit | 693a54ea7ac6bdd229e0a297fc023d25263077b9 (patch) | |
tree | 2ee0a2107b5f20b4992cf80892c4c4f4a8ed75de /testsuite/tests/module/T11432.hs | |
parent | 525a304f8c010ce73f1456e507aca668eb4917ac (diff) | |
download | haskell-693a54ea7ac6bdd229e0a297fc023d25263077b9.tar.gz |
Improved error message about exported type operators.
There is ambiguty between (1) type constructors and (2) data
constructors in export lists, e.g. '%%' can stand for both of them. This
ambiguity is resolved in favor of (2).
If the exported data constructor is not in scope, but type constructor
with the same name is in scope, GHC should suggest adding 'type' keyword
to resolve ambiguity in favor of (1) and enabling 'TypeOperators'
extension.
The patch only extends the error message.
See Trac #11432.
Test Plan: `make test`
Reviewers: simonpj, bgamari, austin
Reviewed By: simonpj
Subscribers: mpickering, thomie, goldfire, kosmikus
Differential Revision: https://phabricator.haskell.org/D1902
GHC Trac Issues: #11432
Diffstat (limited to 'testsuite/tests/module/T11432.hs')
-rw-r--r-- | testsuite/tests/module/T11432.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/tests/module/T11432.hs b/testsuite/tests/module/T11432.hs new file mode 100644 index 0000000000..408935d4ec --- /dev/null +++ b/testsuite/tests/module/T11432.hs @@ -0,0 +1,9 @@ +{- +We expect to get a suggestion to add 'type' keyword +and enable TypeOperators extension. +-} + +{-# LANGUAGE TypeOperators #-} +module T11432 ((-.->)(..)) where + +newtype (f -.-> g) a = Fn { apFn :: f a -> g a } |