]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: factor out endPos call
authorRobert Griesemer <gri@golang.org>
Thu, 5 Sep 2024 00:19:14 +0000 (17:19 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 5 Sep 2024 22:09:28 +0000 (22:09 +0000)
Preparation for generation of function literal type checking code
from types2 source.

Change-Id: I6b3029c34c2507d356ac8874154537bc6c38a715
Reviewed-on: https://go-review.googlesource.com/c/go/+/610995
Reviewed-by: Tim King <taking@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

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

index 1afdee2d4d2be28a7ecdd9c1c75f2bc91aa5fd82..30fa05673cdda9a15efedca74b368db52c00e6c0 100644 (file)
@@ -1127,7 +1127,7 @@ func (check *Checker) exprInternal(T *target, x *operand, e syntax.Expr, hint Ty
                        // Set the Scope's extent to the complete "func (...) {...}"
                        // so that Scope.Innermost works correctly.
                        sig.scope.pos = e.Pos()
-                       sig.scope.end = syntax.EndPos(e)
+                       sig.scope.end = endPos(e)
                        if !check.conf.IgnoreFuncBodies && e.Body != nil {
                                // Anonymous functions are considered part of the
                                // init expression/func declaration which contains
index 55d38609963629d25816378e9fe22361f7e8ad0e..ebc662e9663c39cd4bec56407fda8e1058e60353 100644 (file)
@@ -1105,7 +1105,7 @@ func (check *Checker) exprInternal(T *target, x *operand, e ast.Expr, hint Type)
                        // Set the Scope's extent to the complete "func (...) {...}"
                        // so that Scope.Innermost works correctly.
                        sig.scope.pos = e.Pos()
-                       sig.scope.end = e.End()
+                       sig.scope.end = endPos(e)
                        if !check.conf.IgnoreFuncBodies && e.Body != nil {
                                // Anonymous functions are considered part of the
                                // init expression/func declaration which contains