]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: resolve cgo base type names
authorRob Findley <rfindley@google.com>
Tue, 9 May 2023 15:24:28 +0000 (11:24 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 23 May 2023 13:22:25 +0000 (13:22 +0000)
commit40bdc5618053c16e171473b99186affcbda2166c
treec8a888b8e26db4626cca4e03b5b79172257c1a65
parentf81c885819cfca1b92ee64abb0b932e4f73b5049
go/types: resolve cgo base type names

When associating methods with their receiver base, we need to implement
the same indirection through Cgo types as is done for selector
expressions. This fixes a bug where methods declared on aliases of Cgo
types were not associated with their receiver.

While porting to types2, align the types2 testFiles helper with the
go/types implementation. In order to avoid call-site bloat, switch to an
options pattern for configuring the Config used to type-check.

Fixes golang/go#59944

Change-Id: Id14101f01c122b6c856ae5453bd00ec07e83f414
Reviewed-on: https://go-review.googlesource.com/c/go/+/493877
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/types2/check_test.go
src/cmd/compile/internal/types2/issues_test.go
src/cmd/compile/internal/types2/resolver.go
src/go/types/check_test.go
src/go/types/issues_test.go
src/go/types/resolver.go