1
0
mirror of https://github.com/golang/go synced 2024-11-26 15:36:59 -07:00
go/test/typeparam
Dan Scales e87c4bb3ef cmd/compile: fix noder.Addr() to not call typechecker
Simple change to avoid calling the old typechecker in noder.Addr(). This
fixes cases where generic code calls a pointer method with a non-pointer
receiver.

Added test typeparam/lockable.go that now works with this change.

For lockable.go to work, also fix incorrect check to decide whether to
translate an OXDOT now or later. We should delay translating an OXDOT
until instantiation (because we don't know how embedding, etc. will
work) if the receiver has any typeparam, not just if the receiver type
is a simple typeparam. We also have to handle OXDOT for now in
IsAddressable(), until we can remove calls to the old typechecker in
(*irgen).funcBody().

Change-Id: I77ee5efcef9a8f6c7133564106a32437e36ba4bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/300990
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-03-12 02:30:33 +00:00
..
absdiff.go cmd/compile: deal with helper generic types that add methods to T 2021-03-10 17:36:55 +00:00
combine.go cmd/compile: deal with closures in generic functions and instantiated function values 2021-02-26 18:57:20 +00:00
cons.go cmd/compile: get instantiated generic types working with interfaces 2021-03-09 16:37:52 +00:00
fact.go
importtest.go
index.go
list.go
lockable.go cmd/compile: fix noder.Addr() to not call typechecker 2021-03-12 02:30:33 +00:00
map.go
min.go
ordered.go cmd/compile: get instantiated generic types working with interfaces 2021-03-09 16:37:52 +00:00
pair.go
settable.go cmd/compile: fix handling of partially inferred type arguments 2021-03-11 00:31:14 +00:00
smallest.go
smoketest.go
stringable.go
stringer.go
struct.go
sum.go
tparam1.go
value.go