]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: slightly tighter checks in Checker.use
authorRobert Griesemer <gri@golang.org>
Tue, 28 Mar 2023 18:18:40 +0000 (11:18 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 29 Mar 2023 20:53:12 +0000 (20:53 +0000)
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>

src/cmd/compile/internal/types2/call.go
src/go/types/call.go

index bb82c2464e4ba3fa95d393238c471e180a492921..ec814995a94621c9a6c5e33761c96e7cca9c63c9 100644 (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
                }
index f75043d5dcfdf44dab588861ace83fecb042db28..bdcfd9d56b3e568219dba77eb27a4f4583b8bdd0 100644 (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
                }