Add some ast.Expr.IsEtc methods

This commit is contained in:
Nigel Tao committed 2021-03-28 23:07:21 +11:00
1 parent b645180357
commit 41e407a774
7 files changed
+58 -48

No files matched your search

+2 -2
View File
@@ -45,8 +45,8 @@ func (g *gen) needDerivedVar(name t.ID) bool {
switch p.Kind() {
case a.KExpr:
// Look for p matching "args.name.etc(etc)".
recv, meth, args := p.AsExpr().IsMethodCall()
if recv == nil {
recv, meth, args, ok := p.AsExpr().IsMethodCall()
if !ok {
return nil
}
if recv.IsArgsDotFoo() == name {