X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Frename%2FRnPat.lhs;h=63672553501c4ccd7f83d57c5766b942076264b7;hb=59300a7161f44b3a2afe381a6ccd914043a32c4f;hp=b0946285801d82f89dc961d584f78ebb139c1650;hpb=d64022dc071b587c20a693b7f355f69dc110b707;p=ghc-hetmet.git diff --git a/compiler/rename/RnPat.lhs b/compiler/rename/RnPat.lhs index b094628..6367255 100644 --- a/compiler/rename/RnPat.lhs +++ b/compiler/rename/RnPat.lhs @@ -220,9 +220,7 @@ rnPats ctxt pats thing_inside -- Nor can we check incrementally for shadowing, else we'll -- complain *twice* about duplicates e.g. f (x,x) = ... ; let names = collectPatsBinders pats' - ; checkDupNames doc_pat names - ; checkShadowedNames doc_pat envs_before - [(nameSrcSpan name, nameOccName name) | name <- names] + ; addErrCtxt doc_pat $ checkDupAndShadowedNames envs_before names ; thing_inside pats' } } where doc_pat = ptext (sLit "In") <+> pprMatchContext ctxt @@ -456,7 +454,7 @@ rnHsRecFields1 ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot } rn_fld pun_ok parent (HsRecField { hsRecFieldId = fld , hsRecFieldArg = arg , hsRecPun = pun }) - = do { fld' <- lookupLocatedSubBndr parent doc fld + = do { fld' <- wrapLocM (lookupSubBndr parent doc) fld ; arg' <- if pun then do { checkErr pun_ok (badPun fld) ; return (name_to_arg fld') } @@ -481,7 +479,7 @@ rnHsRecFields1 ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot } extras = [ HsRecField { hsRecFieldId = L loc f , hsRecFieldArg = name_to_arg (L loc f) - , hsRecPun = True } + , hsRecPun = False } | f <- absent_flds ] ; return (flds ++ extras) }