[commit: ghc] master: Two improved error messages (0e16cbf)

git at git.haskell.org git at git.haskell.org
Fri Sep 26 11:35:05 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0e16cbf34d5d882c6f4800295db5fa5e2b42c342/ghc

>---------------------------------------------------------------

commit 0e16cbf34d5d882c6f4800295db5fa5e2b42c342
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Sep 26 10:54:23 2014 +0100

    Two improved error messages
    
    I'm not quite sure why these have improved following the previous
    four commits, but I'm quite happy about it


>---------------------------------------------------------------

0e16cbf34d5d882c6f4800295db5fa5e2b42c342
 .../tests/indexed-types/should_fail/T8227.stderr      | 14 ++++++--------
 .../tests/indexed-types/should_fail/T8518.stderr      | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/testsuite/tests/indexed-types/should_fail/T8227.stderr b/testsuite/tests/indexed-types/should_fail/T8227.stderr
index 8d490d6..6bea619 100644
--- a/testsuite/tests/indexed-types/should_fail/T8227.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T8227.stderr
@@ -1,15 +1,13 @@
 
-T8227.hs:16:27:
-    Couldn't match type ‘Scalar (V (Scalar (V a)))’ with ‘Scalar (V a)’
-    NB: ‘Scalar’ is a type function, and may not be injective
-    Expected type: Scalar (V a)
-      Actual type: Scalar (V (Scalar (V a)))
-                   -> Scalar (V (Scalar (V a)))
+T8227.hs:16:44:
+    Couldn't match type ‘Scalar (V a)’
+                  with ‘Scalar (V a) -> Scalar (V a)’
+    Expected type: Scalar (V (Scalar (V a)))
+      Actual type: Scalar (V a)
     Relevant bindings include
       seg :: a (bound at T8227.hs:16:21)
       eps :: Scalar (V a) (bound at T8227.hs:16:17)
       absoluteToParam :: Scalar (V a) -> a -> Scalar (V a)
         (bound at T8227.hs:16:1)
+    In the first argument of ‘arcLengthToParam’, namely ‘eps’
     In the expression: arcLengthToParam eps eps
-    In an equation for ‘absoluteToParam’:
-        absoluteToParam eps seg = arcLengthToParam eps eps
diff --git a/testsuite/tests/indexed-types/should_fail/T8518.stderr b/testsuite/tests/indexed-types/should_fail/T8518.stderr
index e5ef99e..d7c2010 100644
--- a/testsuite/tests/indexed-types/should_fail/T8518.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T8518.stderr
@@ -1,4 +1,23 @@
 
+T8518.hs:14:18:
+    Could not deduce (F c ~ Maybe (F c))
+    from the context (Continuation c)
+      bound by the type signature for
+                 callCont :: Continuation c => c -> Z c -> B c -> Maybe (F c)
+      at T8518.hs:13:13-64
+    Relevant bindings include
+      b :: B c (bound at T8518.hs:14:14)
+      z :: Z c (bound at T8518.hs:14:12)
+      c :: c (bound at T8518.hs:14:10)
+      callCont :: c -> Z c -> B c -> Maybe (F c) (bound at T8518.hs:14:1)
+    In the expression: rpt (4 :: Int) c z b
+    In an equation for ‘callCont’:
+        callCont c z b
+          = rpt (4 :: Int) c z b
+          where
+              rpt 0 c' z' b' = fromJust (fst <$> (continue c' z' b'))
+              rpt i c' z' b' = let ... in rpt (i - 1) c''
+
 T8518.hs:17:78:
     Could not deduce (F a1 ~ (Z a1 -> B a1 -> F a1))
     from the context (Continuation c)



More information about the ghc-commits mailing list