[project @ 2005-04-16 22:46:01 by simonpj]
authorsimonpj <unknown>
Sat, 16 Apr 2005 22:46:01 +0000 (22:46 +0000)
committersimonpj <unknown>
Sat, 16 Apr 2005 22:46:01 +0000 (22:46 +0000)
Improve kind error msg; may make some tests change their output

ghc/compiler/typecheck/TcUnify.lhs

index b080809..ec5c9a4 100644 (file)
@@ -1266,11 +1266,14 @@ checkExpectedKind ty act_kind exp_kind
                <+> ptext SLIT("is lifted")
 
            | otherwise                 -- E.g. Monad [Int]
-           = sep [ ptext SLIT("Expecting kind") <+> quotes (pprKind exp_kind) <> comma,
-                   ptext SLIT("but") <+> quotes (ppr ty) <+> 
-                   ptext SLIT("has kind") <+> quotes (pprKind act_kind)]
+           = ptext SLIT("Kind mis-match")
+
+       more_info = sep [ ptext SLIT("Expected kind") <+> 
+                               quotes (pprKind exp_kind) <> comma,
+                         ptext SLIT("but") <+> quotes (ppr ty) <+> 
+                               ptext SLIT("has kind") <+> quotes (pprKind act_kind)]
    in
-   failWithTc (ptext SLIT("Kind error:") <+> err) 
+   failWithTc (err $$ more_info)
    }
 \end{code}