Improve error locations
[ghc-hetmet.git] / compiler / rename / RnPat.lhs
index b49e1cd..6367255 100644 (file)
@@ -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
@@ -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) }