]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types2: use syntax.EndPos instead of local computation
authorRobert Griesemer <gri@golang.org>
Mon, 17 Jun 2024 22:02:10 +0000 (15:02 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 26 Jul 2024 20:11:46 +0000 (20:11 +0000)
commit88bd9852394c02a71040226d523903bcb718e51c
treea5f875483deb8febb49e76db6966eeb004357625
parente7b7f44ff82e26cf4e548f35f2a9988e6a4a05aa
cmd/compile/internal/types2: use syntax.EndPos instead of local computation

Previously, the end position for a select statement clause body was
computed explicitly as the start of the next clause or the closing "}"
of the select statement, respectively.

Since syntax.EndPos computes the end position of a node, there's no
need to compute these positions "manually", we can simply use the
syntax.ExdPos for each clause. The positions are not exactly the
same as before but for the purpose of identifier visibility in
scopes there is no semantic change.

Simplifies the code and brings it more in line with go/types.

Change-Id: I24bca85a131a0ea31a2adaafc08ab713450258fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/593016
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/stmt.go