X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FDsBinds.lhs;h=39e7e298abaf37d70c8e25fdaac2198e3fc95493;hp=85883dc05fadf427228d9de08fae229a120e58d1;hb=d9a655dad8e013e41c74dca98fb86c4ed6f29879;hpb=fdf8656855d26105ff36bdd24d41827b05037b91 diff --git a/compiler/deSugar/DsBinds.lhs b/compiler/deSugar/DsBinds.lhs index 85883dc..39e7e29 100644 --- a/compiler/deSugar/DsBinds.lhs +++ b/compiler/deSugar/DsBinds.lhs @@ -493,6 +493,15 @@ dsSpec :: Maybe CoreExpr -- Just rhs => RULE is for a local binding -> Located TcSpecPrag -> DsM (Maybe (OrdList (Id,CoreExpr), CoreRule)) dsSpec mb_poly_rhs (L loc (SpecPrag poly_id spec_co spec_inl)) + | isJust (isClassOpId_maybe poly_id) + = putSrcSpanDs loc $ + do { warnDs (ptext (sLit "Ignoring useless SPECIALISE pragma for class method selector") + <+> quotes (ppr poly_id)) + ; return Nothing } -- There is no point in trying to specialise a class op + -- Moreover, classops don't (currently) have an inl_sat arity set + -- (it would be Just 0) and that in turn makes makeCorePair bleat + + | otherwise = putSrcSpanDs loc $ do { let poly_name = idName poly_id ; spec_name <- newLocalName poly_name @@ -598,13 +607,13 @@ decomposeRuleLhs bndrs lhs bad_shape_msg = hang (ptext (sLit "RULE left-hand side too complicated to desugar")) 2 (ppr opt_lhs) - dead_msg bndr = hang (ptext (sLit "Forall'd") <+> pp_bndr bndr - <+> ptext (sLit "is not bound in RULE lhs")) + dead_msg bndr = hang (sep [ ptext (sLit "Forall'd") <+> pp_bndr bndr + , ptext (sLit "is not bound in RULE lhs")]) 2 (ppr opt_lhs) pp_bndr bndr - | isTyVar bndr = ptext (sLit "type variable") <+> ppr bndr - | isEvVar bndr = ptext (sLit "constraint") <+> ppr bndr <+> dcolon <+> ppr (evVarPred bndr) - | otherwise = ptext (sLit "variable") <+> ppr bndr + | isTyVar bndr = ptext (sLit "type variable") <+> quotes (ppr bndr) + | isEvVar bndr = ptext (sLit "constraint") <+> quotes (ppr (evVarPred bndr)) + | otherwise = ptext (sLit "variable") <+> quotes (ppr bndr) \end{code} Note [Simplifying the left-hand side of a RULE]