]> Cypherpunks repositories - gostls13.git/commit
go/types: determine hasPtrRecv property from source rather than type
authorRobert Griesemer <gri@golang.org>
Wed, 3 Oct 2018 21:40:09 +0000 (14:40 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 4 Oct 2018 15:21:01 +0000 (15:21 +0000)
commitd6ab653c78df74d49d882774228bda459de6c584
tree2c12d630e5b401f440d9606fd55ddd5d96f05010
parent62e5215a2a12d95d1ce08cb6c996c3667e346779
go/types: determine hasPtrRecv property from source rather than type

LookupFieldOrMethod needs to know if a method receiver is a pointer
type. Until now this was computed from the the method signature's
receiver, which required the method signature to be type-checked.
Furthermore, it required the receiver to be set before the method
signature was fully type-checked in some cases (see issue #6638).

This CL remembers this property during object resolution, when we
know it from the source.

With this CL, method signatures don't need to be type-checked before
they can be looked up; this is a first step towards separating
type checking of types and type-checking of associated methods.

Updates #23203.
Updates #26854.

Change-Id: Ie3eb7976e8fe8176ea1b284fa7471a4b7000f80b
Reviewed-on: https://go-review.googlesource.com/c/139422
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/methodset.go
src/go/types/object.go
src/go/types/resolver.go
src/go/types/typexpr.go