Skip to content

Commit

Permalink
go/types, types2: factor out endPos call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
griesemer authored and gopherbot committed Sep 5, 2024
1 parent e3f3083 commit 829d1b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/types2/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/go/types/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 829d1b3

Please sign in to comment.