Interface methods can't have function bodies, so there's no need to
process their parameter lists as variable declarations. The only
possible reason would be to check for duplicate parameter names and/or
invalid types, but we do that anyway, and have regression tests for it
(test/funcdup.go).
Change-Id: Iedb15335467caa5d872dbab829bf32ab8cf6204d
Reviewed-on: https://go-review.googlesource.com/31430
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
if isblank(n.Left) {
yyerror("methods must have a unique non-blank name")
}
-
- n.Func = new(Func)
- n.Func.FCurfn = Curfn
- dclcontext = PPARAM
-
- funcstart(n)
- funcargs(n.Right)
-
- // funcbody is normally called after the parser has
- // seen the body of a function but since an interface
- // field declaration does not have a body, we must
- // call it now to pop the current declaration context.
- dclcontext = PAUTO
-
- funcbody(n)
}
// declare the function proper