X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Frename%2FRnTypes.lhs;h=055cd349ad77a701672a6832c56467d78c1f5bc6;hp=d7d435ce974d97c2d0df0ad116ef0939b78539c6;hb=afef39736dcde6f4947a6f362f9e6b3586933db4;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1 diff --git a/compiler/rename/RnTypes.lhs b/compiler/rename/RnTypes.lhs index d7d435c..055cd34 100644 --- a/compiler/rename/RnTypes.lhs +++ b/compiler/rename/RnTypes.lhs @@ -416,7 +416,14 @@ checkPrecMatch True op (MatchGroup ms _) = checkPrec op (unLoc p1) False `thenM_` checkPrec op (unLoc p2) True - check _ = panic "checkPrecMatch" + check _ = return () + -- This can happen. Consider + -- a `op` True = ... + -- op = ... + -- The infix flag comes from the first binding of the group + -- but the second eqn has no args (an error, but not discovered + -- until the type checker). So we don't want to crash on the + -- second eqn. checkPrec op (ConPatIn op1 (InfixCon _ _)) right = lookupFixityRn op `thenM` \ op_fix@(Fixity op_prec op_dir) -> @@ -745,12 +752,10 @@ checkTupSize tup_size forAllWarn doc ty (L loc tyvar) = ifOptM Opt_WarnUnusedMatches $ - setSrcSpan loc $ - addWarn (sep [ptext SLIT("The universally quantified type variable") <+> quotes (ppr tyvar), - nest 4 (ptext SLIT("does not appear in the type") <+> quotes (ppr ty))] + addWarnAt loc (sep [ptext SLIT("The universally quantified type variable") <+> quotes (ppr tyvar), + nest 4 (ptext SLIT("does not appear in the type") <+> quotes (ppr ty))] $$ - doc - ) + doc) bogusCharError c = ptext SLIT("character literal out of range: '\\") <> char c <> char '\''