Commit cb989e2f authored by Alan Zimmerman's avatar Alan Zimmerman
Browse files

API Annotaions:add name in PatBind Match

A PatBind operates similarly to a FunBind, and so the RdrName and
infix/prefix state needs to be captured for use in API Annotations.
parent 380b25ea
......@@ -471,13 +471,13 @@ mkPatSynMatchGroup (L loc patsyn_name) (L _ decls) =
; when (length matches /= 1) (wrongNumberErr loc)
; return $ mkMatchGroup FromSource matches }
where
fromDecl (L loc decl@(ValD (PatBind pat@(L _ (ConPatIn (L _ name) details)) rhs _ _ _))) =
fromDecl (L loc decl@(ValD (PatBind pat@(L _ (ConPatIn ln@(L _ name) details)) rhs _ _ _))) =
do { unless (name == patsyn_name) $
wrongNameBindingErr loc decl
; match <- case details of
PrefixCon pats -> return $ Match NonFunBindMatch pats Nothing rhs
PrefixCon pats -> return $ Match (FunBindMatch ln False) pats Nothing rhs
InfixCon pat1 pat2 ->
return $ Match NonFunBindMatch [pat1, pat2] Nothing rhs
return $ Match (FunBindMatch ln True) [pat1, pat2] Nothing rhs
RecCon{} -> recordPatSynErr loc pat
; return $ L loc match }
fromDecl (L loc decl) = extraDeclErr loc decl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment