X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnSource.lhs;h=50a9dcd1456e6e984aed0c23ab7d4879564011c0;hb=e7b69c553c58133ddbdc756bec03a43d35b0be5e;hp=e1af3e5f9f1212d31b54643647d9bc4919dd511e;hpb=55d04fc7a6fbd58358f284bd84648dad09046f60;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnSource.lhs b/ghc/compiler/rename/RnSource.lhs index e1af3e5..50a9dcd 100644 --- a/ghc/compiler/rename/RnSource.lhs +++ b/ghc/compiler/rename/RnSource.lhs @@ -633,13 +633,17 @@ rnForAll doc forall_tyvars ctxt ty rnContext :: SDoc -> RdrNameContext -> RnMS RenamedContext rnContext doc ctxt = mapRn rn_pred ctxt `thenRn` \ theta -> - let - (_, dups) = removeDupsEq theta - -- We only have equality, not ordering - in + -- Check for duplicate assertions -- If this isn't an error, then it ought to be: - mapRn (addWarnRn . dupClassAssertWarn theta) dups `thenRn_` + ifOptRn Opt_WarnMisc ( + let + (_, dups) = removeDupsEq theta + -- We only have equality, not ordering + in + mapRn (addWarnRn . dupClassAssertWarn theta) dups + ) `thenRn_` + returnRn theta where --Someone discovered that @CCallable@ and @CReturnable@ @@ -854,11 +858,9 @@ badDataCon name = hsep [ptext SLIT("Illegal data constructor name"), quotes (ppr name)] forAllWarn doc ty tyvar - = doptRn Opt_WarnUnusedMatches `thenRn` \ warn_unused -> case () of - () | not warn_unused -> returnRn () - | otherwise - -> getModeRn `thenRn` \ mode -> - case mode of { + = ifOptRn Opt_WarnUnusedMatches $ + getModeRn `thenRn` \ mode -> + case mode of { #ifndef DEBUG InterfaceMode -> returnRn () ; -- Don't warn of unused tyvars in interface files -- unless DEBUG is on, in which case it is slightly