X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcDefaults.lhs;fp=ghc%2Fcompiler%2Ftypecheck%2FTcDefaults.lhs;h=6fe697ba590b246f1c620306797232326e350e5b;hb=a6eede3173cee960884e732f40b0998cf84ae015;hp=758258b2955a6efd4d6ad13a0b39ef2565d7c302;hpb=35dff9ff5076f0a387f6b57d9c19b8f5fc00f9a2;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcDefaults.lhs b/ghc/compiler/typecheck/TcDefaults.lhs index 758258b..6fe697b 100644 --- a/ghc/compiler/typecheck/TcDefaults.lhs +++ b/ghc/compiler/typecheck/TcDefaults.lhs @@ -54,8 +54,9 @@ tc_defaults [DefaultDecl mono_tys locn] returnTc tau_tys -tc_defaults decls - = failWithTc (dupDefaultDeclErr decls) +tc_defaults decls@(DefaultDecl _ loc : _) = + tcAddSrcLoc loc $ + failWithTc (dupDefaultDeclErr decls) defaultDeclCtxt = ptext SLIT("when checking that each type in a default declaration") @@ -63,11 +64,8 @@ defaultDeclCtxt = ptext SLIT("when checking that each type in a default declara dupDefaultDeclErr (DefaultDecl _ locn1 : dup_things) - = vcat (item1 : map dup_item dup_things) + = hang (ptext SLIT("Multiple default declarations")) + 4 (vcat (map pp dup_things)) where - item1 - = addShortErrLocLine locn1 (ptext SLIT("multiple default declarations")) - - dup_item (DefaultDecl _ locn) - = addShortErrLocLine locn (ptext SLIT("here was another default declaration")) + pp (DefaultDecl _ locn) = ptext SLIT("here was another default declaration") <+> ppr locn \end{code}