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/overloadedlists | |
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/overloadedlists')
-rw-r--r-- | testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr | 67 | ||||
-rw-r--r-- | testsuite/tests/overloadedlists/should_fail/overloadedlistsfail02.stderr | 24 |
2 files changed, 48 insertions, 43 deletions
diff --git a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr index dbc250d794..7a43f4f778 100644 --- a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr +++ b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr @@ -1,38 +1,41 @@ overloadedlistsfail01.hs:5:8: error: - Ambiguous type variable ‘a0’ arising from a use of ‘print’ - prevents the constraint ‘(Show a0)’ from being solved. - Probable fix: use a type annotation to specify what ‘a0’ should be. - These potential instances exist: - instance [safe] Show Version -- Defined in ‘Data.Version’ - instance Show Module -- Defined in ‘GHC.Show’ - instance Show Ordering -- Defined in ‘GHC.Show’ - ...plus 26 others - (use -fprint-potential-instances to see them all) - In the expression: print [1] - In an equation for ‘main’: main = print [1] + • Ambiguous type variable ‘a0’ arising from a use of ‘print’ + prevents the constraint ‘(Show a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: + instance Show Ordering -- Defined in ‘GHC.Show’ + instance Show Integer -- Defined in ‘GHC.Show’ + instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ + ...plus 22 others + ...plus four instance involving out-of-scope typess + (use -fprint-potential-instances to see them all) + • In the expression: print [1] + In an equation for ‘main’: main = print [1] overloadedlistsfail01.hs:5:14: error: - Ambiguous type variable ‘a0’ arising from an overloaded list - prevents the constraint ‘(IsList a0)’ from being solved. - Probable fix: use a type annotation to specify what ‘a0’ should be. - These potential instances exist: - instance IsList Version -- Defined in ‘GHC.Exts’ - instance IsList [a] -- Defined in ‘GHC.Exts’ - In the first argument of ‘print’, namely ‘[1]’ - In the expression: print [1] - In an equation for ‘main’: main = print [1] + • Ambiguous type variable ‘a0’ arising from an overloaded list + prevents the constraint ‘(GHC.Exts.IsList a0)’ from being solved. + Probable fix: use a type annotation to specify what ‘a0’ should be. + These potential instances exist: + instance GHC.Exts.IsList [a] -- Defined in ‘GHC.Exts’ + ...plus one instance involving out-of-scope types + (use -fprint-potential-instances to see them all) + • In the first argument of ‘print’, namely ‘[1]’ + In the expression: print [1] + In an equation for ‘main’: main = print [1] overloadedlistsfail01.hs:5:15: error: - Ambiguous type variable ‘a0’ arising from the literal ‘1’ - prevents the constraint ‘(Num (Item 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 - (use -fprint-potential-instances to see them all) - In the expression: 1 - In the first argument of ‘print’, namely ‘[1]’ - In the expression: print [1] + • Ambiguous type variable ‘a0’ arising from the literal ‘1’ + prevents the constraint ‘(Num + (GHC.Exts.Item 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 + (use -fprint-potential-instances to see them all) + • In the expression: 1 + In the first argument of ‘print’, namely ‘[1]’ + In the expression: print [1] diff --git a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail02.stderr b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail02.stderr index 4597e1ce56..e0be7ab4e5 100644 --- a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail02.stderr +++ b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail02.stderr @@ -1,11 +1,13 @@ -
-overloadedlistsfail02.hs:6:8:
- No instance for (IsList Foo) arising from an overloaded list
- In the expression: [7]
- In an equation for ‘test’: test = [7]
-
-overloadedlistsfail02.hs:6:9:
- No instance for (Num (Item Foo)) arising from the literal ‘7’
- In the expression: 7
- In the expression: [7]
- In an equation for ‘test’: test = [7]
+ +overloadedlistsfail02.hs:6:8: error: + • No instance for (GHC.Exts.IsList Foo) + arising from an overloaded list + • In the expression: [7] + In an equation for ‘test’: test = [7] + +overloadedlistsfail02.hs:6:9: error: + • No instance for (Num (GHC.Exts.Item Foo)) + arising from the literal ‘7’ + • In the expression: 7 + In the expression: [7] + In an equation for ‘test’: test = [7] |