From 48d1866e9051e52b80c9c88547bd66d66483f1d5 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Fri, 10 Mar 2017 11:46:50 +0000 Subject: Improve error messages for skolems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In error messages like this • Couldn't match type ‘c’ with ‘f0 (a -> b)’ ‘c’ is a rigid type variable bound by the type signature for: f :: ((a -> b) -> b) -> forall c. c -> a we need to take case both to actually show that 'forall c', and to make sure that its name lines with the 'c' in the error message. This has been shaky for some time, and this commit puts it on solid ground. See TcRnTypes: Note [SigSkol SkolemInfo] The main changes are * SigSkol gets an extra field that records the way in which the type signature was skolemised. * The type in SigSkol is now the /un/-skolemised version * pprSkolemInfo uses the info to make the tidy type line up nicely Lots of error message wibbles! --- testsuite/tests/typecheck/should_fail/tcfail072.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/tests/typecheck/should_fail/tcfail072.stderr') diff --git a/testsuite/tests/typecheck/should_fail/tcfail072.stderr b/testsuite/tests/typecheck/should_fail/tcfail072.stderr index 1d005be670..15c4556480 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail072.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail072.stderr @@ -3,7 +3,7 @@ tcfail072.hs:23:13: error: • Could not deduce (Ord p0) arising from a use of ‘g’ from the context: (Ord p, Ord q) bound by the type signature for: - g :: (Ord p, Ord q) => AB p q -> Bool + g :: forall p q. (Ord p, Ord q) => AB p q -> Bool at tcfail072.hs:22:1-38 The type variable ‘p0’ is ambiguous These potential instances exist: -- cgit v1.2.1