diff options
author | Jose Pedro Magalhaes <jpm@cs.uu.nl> | 2013-09-04 10:09:17 +0200 |
---|---|---|
committer | Jose Pedro Magalhaes <jpm@cs.uu.nl> | 2013-09-04 17:28:19 +0200 |
commit | 5335e56953c4bbe18166039c06256e725f074b64 (patch) | |
tree | 2190cf3f0f46e6c0622c023151c061bfd6b6c0eb | |
parent | d02a50ee1437a24a0fb584286cf8f16cff59d217 (diff) | |
download | haskell-5335e56953c4bbe18166039c06256e725f074b64.tar.gz |
Turn manual Typeable instances into errors; fixes #8132
-rw-r--r-- | compiler/typecheck/TcInstDcls.lhs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/typecheck/TcInstDcls.lhs b/compiler/typecheck/TcInstDcls.lhs index 1481b2552d..9f89afe0af 100644 --- a/compiler/typecheck/TcInstDcls.lhs +++ b/compiler/typecheck/TcInstDcls.lhs @@ -409,7 +409,7 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls -- Remove any handwritten instance of poly-kinded Typeable and warn ; dflags <- getDynFlags ; when (wopt Opt_WarnTypeableInstances dflags) $ - mapM_ (addWarnTc . instMsg) typeable_instances + mapM_ (failWithTc . instMsg) typeable_instances -- Check that if the module is compiled with -XSafe, there are no -- hand written instances of old Typeable as then unsafe casts could be @@ -444,7 +444,7 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls typInstErr = ptext $ sLit $ "Can't create hand written instances of Typeable in Safe" ++ " Haskell! Can only derive them" - instMsg i = hang (ptext (sLit $ "Typeable instances can only be derived; ignoring " + instMsg i = hang (ptext (sLit $ "Typeable instances can only be derived; replace " ++ "the following instance:")) 2 (pprInstance (iSpec i)) |