]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: remove non-test uses of Scope.LookupParent
authorRobert Griesemer <gri@golang.org>
Fri, 27 Sep 2024 17:24:16 +0000 (10:24 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 27 Sep 2024 18:17:09 +0000 (18:17 +0000)
commit80316510d3b97c6dc7b6a380e18e9f41467b3c10
treeb55c21834cd3ef5ee900aa37fc449bb5567f965f
parent1646f725bb15ec857c4b6945bcd2d47f615c6ec3
go/types, types2: remove non-test uses of Scope.LookupParent

This moves the implementation of Scope.LookupParent into
environment.lookupScope where it encapsulates the use of
the current environment's position. At least in types2,
that position can be removed, because it is never set.

With this, the type checker doesn't rely on position
information anymore for looking up objects during type
checking.

LookupParent is still called from tests and some go/types
code.

Updates #69673.

Change-Id: I7159ba95b71cf33cc3b16058aa19327e166224b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/616337
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/check.go
src/cmd/compile/internal/types2/scope.go
src/cmd/compile/internal/types2/typexpr.go
src/go/types/check.go
src/go/types/scope.go
src/go/types/typexpr.go