[commit: ghc] master: Small improvement to unsaturated-type-function error message (4c359f5)

git at git.haskell.org git at git.haskell.org
Thu Sep 4 10:04:23 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4c359f5a50bc8ab1fcb51632f08f0cbbeb5e6d47/ghc

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

commit 4c359f5a50bc8ab1fcb51632f08f0cbbeb5e6d47
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Sep 3 21:47:43 2014 +0100

    Small improvement to unsaturated-type-function error message


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

4c359f5a50bc8ab1fcb51632f08f0cbbeb5e6d47
 compiler/typecheck/TcValidity.lhs                      | 4 +++-
 testsuite/tests/indexed-types/should_fail/T9433.stderr | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcValidity.lhs b/compiler/typecheck/TcValidity.lhs
index 9e518c7..ad81623 100644
--- a/compiler/typecheck/TcValidity.lhs
+++ b/compiler/typecheck/TcValidity.lhs
@@ -332,8 +332,10 @@ check_syn_tc_app ctxt rank ty tc tys
   = mapM_ check_arg tys
 
   | otherwise
-  = failWithTc (arityErr "Type synonym" (tyConName tc) tc_arity n_args)
+  = failWithTc (arityErr flavour (tyConName tc) tc_arity n_args)
   where
+    flavour | isSynFamilyTyCon tc = "Type family" 
+            | otherwise           = "Type synonym"
     n_args = length tys
     tc_arity  = tyConArity tc
     check_arg | isSynFamilyTyCon tc = check_arg_type  ctxt rank
diff --git a/testsuite/tests/indexed-types/should_fail/T9433.stderr b/testsuite/tests/indexed-types/should_fail/T9433.stderr
index 0b17f57..51780f1 100644
--- a/testsuite/tests/indexed-types/should_fail/T9433.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T9433.stderr
@@ -1,4 +1,4 @@
 
 T9433.hs:14:6:
-    Type synonym ‘Id’ should have 1 argument, but has been given none
+    Type family ‘Id’ should have 1 argument, but has been given none
     In the type signature for ‘x’: x :: Map Id [Bool]



More information about the ghc-commits mailing list