]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types2: make ptrRecv a method hasPtrRecv of Func
authorRobert Griesemer <gri@golang.org>
Tue, 21 Sep 2021 17:54:08 +0000 (10:54 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 21 Sep 2021 20:28:55 +0000 (20:28 +0000)
commit5efa8ff340d9fcc2dfc7a5136f1ed4067eb5e91e
tree13199f971fdb13245818664f9f4c81c2207c5ccc
parent2fc7df93fe8e540ca101da33fe9157dfa7bdf6aa
cmd/compile/internal/types2: make ptrRecv a method hasPtrRecv of Func

Reading the Func.hasPtrRecv field directly (without consulting a
possibly existing signature) caused some issues in an earlier CL.
The function ptrRecv (in lookup.go) does the right thing but is
not easily discoverable.

Rename ptrRecv to hasPtrRecv and make it a method of Func; rename
Func.hasPtrRecv field to Func.hasPtrRecv_ to avoid name collisions.
Make it clear in field comment that it must not be read through the
hasPtrRecv method.

Change-Id: Ida9856c4789e499538eb34377be781655958fd5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/351310
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/named.go
src/cmd/compile/internal/types2/object.go
src/cmd/compile/internal/types2/resolver.go