summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail140.stderr
diff options
context:
space:
mode:
authorEvan Laforge <qdunkan@gmail.com>2015-11-24 12:43:18 +0100
committerBen Gamari <ben@smart-cactus.org>2015-11-24 14:02:58 +0100
commitc05fdddec71f9dc8ebe62d751ccf03367128072a (patch)
tree4afadb128af4af0f99dfb92fdbb9607bbeb64f04 /testsuite/tests/typecheck/should_fail/tcfail140.stderr
parentf09f2470a76bb08b7f51d2f5663daa672b86f618 (diff)
downloadhaskell-c05fdddec71f9dc8ebe62d751ccf03367128072a.tar.gz
Rearrange error msgs and add section markers (Trac #11014).
This puts the "Relevant bindings" section at the end. It uses a TcErrors.Report Monoid to divide messages by importance and then mappends them together. This is not the most efficient way since there are various intermediate Reports and list appends, but it probably doesn't matter since error messages shouldn't get that large, and are usually prepended. In practice, everything is `important` except `relevantBindings`, which is `supplementary`. ErrMsg's errMsgShortDoc and errMsgExtraInfo were extracted into ErrDoc, which has important, context, and suppelementary fields. Each of those three sections is marked with a bullet character, '•' on unicode terminals and '*' on ascii terminals. Since this breaks tons of tests, I also modified testlib.normalise_errmsg to strip out '•'s. --- Additional notes: To avoid prepending * to an empty doc, I needed to filter empty docs. This seemed less error-prone than trying to modify everyone who produces SDoc to instead produce Maybe SDoc. So I added `Outputable.isEmpty`. Unfortunately it needs a DynFlags, which is kind of bogus, but otherwise I think I'd need another Empty case for SDoc, and then it couldn't be a newtype any more. ErrMsg's errMsgShortString is only used by the Show instance, which is in turn only used by Show HscTypes.SourceError, which is in turn only needed for the Exception instance. So it's probably possible to get rid of errMsgShortString, but that would a be an unrelated cleanup. Fixes #11014. Test Plan: see above Reviewers: austin, simonpj, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: simonpj, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D1427 GHC Trac Issues: #11014
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail140.stderr')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail140.stderr12
1 files changed, 6 insertions, 6 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail140.stderr b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
index 6908f1d595..09eb70c588 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail140.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
@@ -1,30 +1,30 @@
tcfail140.hs:10:7: error:
Couldn't match expected type ‘Integer -> t’ with actual type ‘Int’
- Relevant bindings include bar :: t (bound at tcfail140.hs:10:1)
The function ‘f’ is applied to two arguments,
but its type ‘Int -> Int’ has only one
In the expression: f 3 9
In an equation for ‘bar’: bar = f 3 9
+ Relevant bindings include bar :: t (bound at tcfail140.hs:10:1)
tcfail140.hs:12:10: error:
Couldn't match expected type ‘Integer -> t1’ with actual type ‘Int’
- Relevant bindings include
- rot :: t -> t1 (bound at tcfail140.hs:12:1)
The operator ‘f’ takes two arguments,
but its type ‘Int -> Int’ has only one
In the expression: 3 `f` 4
In an equation for ‘rot’: rot xs = 3 `f` 4
+ Relevant bindings include
+ rot :: t -> t1 (bound at tcfail140.hs:12:1)
tcfail140.hs:14:15: error:
Couldn't match expected type ‘a -> b’ with actual type ‘Int’
- Relevant bindings include
- xs :: [a] (bound at tcfail140.hs:14:5)
- bot :: [a] -> [b] (bound at tcfail140.hs:14:1)
The operator ‘f’ takes two arguments,
but its type ‘Int -> Int’ has only one
In the first argument of ‘map’, namely ‘(3 `f`)’
In the expression: map (3 `f`) xs
+ Relevant bindings include
+ xs :: [a] (bound at tcfail140.hs:14:5)
+ bot :: [a] -> [b] (bound at tcfail140.hs:14:1)
tcfail140.hs:16:8: error:
The constructor ‘Just’ should have 1 argument, but has been given none