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 [dev.typeparams] cmd/compile: make type conversions by type parameters work 2021-02-10 03:33:05 +00:00
importtest.go [dev.typeparams] cmd/compile: use existing findpkg algorithm when importing through types2 2020-11-11 01:11:43 +00:00
index.go [dev.typeparams] cmd/compile: small fixes for stenciling 2021-02-11 21:46:39 +00:00
list.go [dev.typeparams] cmd/compile: support generic types (with stenciling of method calls) 2021-02-18 22:37:06 +00:00
lockable.go cmd/compile: fix noder.Addr() to not call typechecker 2021-03-12 02:30:33 +00:00
map.go [dev.typeparams] cmd/compile: small fixes for stenciling 2021-02-11 21:46:39 +00:00
min.go [dev.typeparams] cmd/compile: small fixes for stenciling 2021-02-11 21:46:39 +00:00
ordered.go cmd/compile: get instantiated generic types working with interfaces 2021-03-09 16:37:52 +00:00
pair.go [dev.typeparams] cmd/compile: support generic types (with stenciling of method calls) 2021-02-18 22:37:06 +00:00
settable.go cmd/compile: fix handling of partially inferred type arguments 2021-03-11 00:31:14 +00:00
smallest.go [dev.typeparams] cmd/compile: small fixes for stenciling 2021-02-11 21:46:39 +00:00
smoketest.go
stringable.go [dev.typeparams] cmd/compile: support generic types (with stenciling of method calls) 2021-02-18 22:37:06 +00:00
stringer.go [dev.typeparams] cmd/compile: small fixes for stenciling 2021-02-11 21:46:39 +00:00
struct.go [dev.typeparams] cmd/compile: support generic types (with stenciling of method calls) 2021-02-18 22:37:06 +00:00
sum.go [dev.typeparams] cmd/compile: small fixes for stenciling 2021-02-11 21:46:39 +00:00
tparam1.go [dev.typeparams] cmd/compile/internal/types2: set compiler error message for undeclared variable 2020-12-02 04:48:13 +00:00
value.go [dev.typeparams] cmd/compile: support generic types (with stenciling of method calls) 2021-02-18 22:37:06 +00:00