diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2015-12-15 16:08:52 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-12-15 20:45:59 +0100 |
commit | e2c917381ff099820b1ee30fcfa8bc0c20cf5c1f (patch) | |
tree | f9295bd3f9ab1e4d4b296960d1f046d1eb37b449 /testsuite/tests/annotations | |
parent | 947e44feebb4e979d7d476ff2aa5c7054a1c0899 (diff) | |
download | haskell-e2c917381ff099820b1ee30fcfa8bc0c20cf5c1f.tar.gz |
Narrow scope of special-case for unqualified printing of names in core libraries
Commit 547c597112954353cef7157cb0a389bc4f6303eb modifies the
pretty-printer to render names from a set of core packages (`base`,
`ghc-prim`, `template-haskell`) as unqualified. The idea here was that
many of these names typically are not in scope but are well-known by the
user and therefore qualification merely introduces noise.
This, however, is a very large hammer and potentially breaks any
consumer who relies on parsing GHC output (hence #11208). This commit
partially reverts this change, now only printing `Constraint` (which
appears quite often in errors) as unqualified.
Fixes #11208.
Updates tests in `array` submodule.
Test Plan: validate
Reviewers: hvr, thomie, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1619
GHC Trac Issues: #11208
Diffstat (limited to 'testsuite/tests/annotations')
3 files changed, 36 insertions, 35 deletions
diff --git a/testsuite/tests/annotations/should_fail/annfail05.stderr b/testsuite/tests/annotations/should_fail/annfail05.stderr index e9b281ecb8..237c238a8d 100644 --- a/testsuite/tests/annotations/should_fail/annfail05.stderr +++ b/testsuite/tests/annotations/should_fail/annfail05.stderr @@ -1,4 +1,5 @@ -
-annfail05.hs:11:1:
- No instance for (Data NoInstances) arising from an annotation
- In the annotation: {-# ANN f NoInstances #-}
+ +annfail05.hs:11:1: error: + • No instance for (Data.Data.Data NoInstances) + arising from an annotation + • In the annotation: {-# ANN f NoInstances #-} diff --git a/testsuite/tests/annotations/should_fail/annfail08.stderr b/testsuite/tests/annotations/should_fail/annfail08.stderr index 66e9c7e29b..6fafaf919e 100644 --- a/testsuite/tests/annotations/should_fail/annfail08.stderr +++ b/testsuite/tests/annotations/should_fail/annfail08.stderr @@ -1,10 +1,11 @@ annfail08.hs:9:1: error: - No instance for (Data (a0 -> a0)) arising from an annotation - (maybe you haven't applied a function to enough arguments?) - In the annotation: {-# ANN f (id + 1) #-} + • No instance for (Data.Data.Data (a0 -> a0)) + arising from an annotation + (maybe you haven't applied a function to enough arguments?) + • In the annotation: {-# ANN f (id + 1) #-} annfail08.hs:9:15: error: - No instance for (Num (a0 -> a0)) arising from a use of ‘+’ - (maybe you haven't applied a function to enough arguments?) - In the annotation: {-# ANN f (id + 1) #-} + • No instance for (Num (a0 -> a0)) arising from a use of ‘+’ + (maybe you haven't applied a function to enough arguments?) + • In the annotation: {-# ANN f (id + 1) #-} diff --git a/testsuite/tests/annotations/should_fail/annfail10.stderr b/testsuite/tests/annotations/should_fail/annfail10.stderr index 5c6f71b486..251f0c317c 100644 --- a/testsuite/tests/annotations/should_fail/annfail10.stderr +++ b/testsuite/tests/annotations/should_fail/annfail10.stderr @@ -1,29 +1,28 @@ annfail10.hs:9:1: error: - Ambiguous type variable ‘a0’ arising from an annotation - prevents the constraint ‘(Data a0)’ from being solved. - Probable fix: use a type annotation to specify what ‘a0’ should be. - These potential instances exist: - instance (Data a, Data b) => Data (Either a b) - -- Defined in ‘Data.Data’ - instance Data All -- Defined in ‘Data.Data’ - instance (Data (f a), Data a, Typeable f) => Data (Alt f a) - -- Defined in ‘Data.Data’ - ...plus 39 others - (use -fprint-potential-instances to see them all) - In the annotation: {-# ANN f 1 #-} + • Ambiguous type variable ‘a0’ arising from an annotation + prevents the constraint ‘(Data.Data.Data a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: + instance (Data.Data.Data a, Data.Data.Data b) => + Data.Data.Data (Either a b) + -- Defined in ‘Data.Data’ + instance Data.Data.Data Ordering -- Defined in ‘Data.Data’ + instance Data.Data.Data Integer -- Defined in ‘Data.Data’ + ...plus 15 others + ...plus 24 instance involving out-of-scope typess + (use -fprint-potential-instances to see them all) + • In the annotation: {-# ANN f 1 #-} annfail10.hs:9:11: error: - Ambiguous type variable ‘a0’ arising from the literal ‘1’ - prevents the constraint ‘(Num a0)’ from being solved. - Probable fix: use a type annotation to specify what ‘a0’ should be. - These potential instances exist: - instance forall k (f :: k -> *) (a :: k). - Num (f a) => - Num (Alt f a) - -- Defined in ‘Data.Monoid’ - instance Num a => Num (Product a) -- Defined in ‘Data.Monoid’ - instance Num a => Num (Sum a) -- Defined in ‘Data.Monoid’ - ...plus 14 others - (use -fprint-potential-instances to see them all) - In the annotation: {-# ANN f 1 #-} + • Ambiguous type variable ‘a0’ arising from the literal ‘1’ + prevents the constraint ‘(Num a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: + instance Num Integer -- Defined in ‘GHC.Num’ + instance Num Double -- Defined in ‘GHC.Float’ + instance Num Float -- Defined in ‘GHC.Float’ + ...plus two others + ...plus 12 instance involving out-of-scope typess + (use -fprint-potential-instances to see them all) + • In the annotation: {-# ANN f 1 #-} |