mirror of
https://github.com/golang/go
synced 2024-11-17 00:54:49 -07:00
go/types, types2: slightly tighter checks in Checker.use
Checker.use is called to check expressions and "use" variables in case of an error. Use Checker.exprOrType instead of just rawExpr. Change-Id: I4da6fa51ef3b0c9b07c453494452836caced9b1a Reviewed-on: https://go-review.googlesource.com/c/go/+/479897 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@google.com>
This commit is contained in:
parent
cc048b32f3
commit
f46ea60f2b
@ -820,7 +820,7 @@ func (check *Checker) use1(e syntax.Expr, lhs bool) bool {
|
||||
}
|
||||
}
|
||||
}
|
||||
check.rawExpr(nil, &x, n, nil, true)
|
||||
check.exprOrType(&x, n, true)
|
||||
if v != nil {
|
||||
v.used = v_used // restore v.used
|
||||
}
|
||||
|
@ -870,7 +870,7 @@ func (check *Checker) use1(e ast.Expr, lhs bool) bool {
|
||||
}
|
||||
}
|
||||
}
|
||||
check.rawExpr(nil, &x, n, nil, true)
|
||||
check.exprOrType(&x, n, true)
|
||||
if v != nil {
|
||||
v.used = v_used // restore v.used
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user