1
0
mirror of https://github.com/golang/go synced 2024-11-16 22:04:50 -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:
Robert Griesemer 2023-03-28 11:18:40 -07:00 committed by Gopher Robot
parent cc048b32f3
commit f46ea60f2b
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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
}