]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] Fix issues related to dictionaries and method calls with embedded...
authorDan Scales <danscales@google.com>
Fri, 18 Jun 2021 21:09:21 +0000 (14:09 -0700)
committerDan Scales <danscales@google.com>
Wed, 23 Jun 2021 23:38:05 +0000 (23:38 +0000)
commitee4fc0c1bc300f181388ef6dd187ca8b8737efd2
treed769935547e6a87112d17809239e3b06f82f90b3
parent8165256bc2e3298b0d612471d7d2e6c005b984de
[dev.typeparams] Fix issues related to dictionaries and method calls with embedded fields

 - Fix handling of method expressions with embedded fields. Fix an
   incorrect lookup for method expressions, which have only the
   top-level type (and don't have DOT operations for the embedded
   fields). Add the embedded field dot operations into the closure.

 - Don't need a dictionary and so don't build a closure if the last
   embedded field reached in a method expression is an interface value.

 - Fix methodWrapper() to use the computed 'dot' node in the
   generic-only part of the code.

 - For a method expression, don't create a generic wrapper if the last
   embedded field reached before the method lookup is an interface.

Copied cmd/compile/internal/types2/testdata/fixedbugs/issue44688.go2 to
test/typeparam/issue44688.go, made it fully runnable (rather than just
for compilation), and added a bunch more tests.

Change-Id: I90c1aa569e1c7272e986c9d2ae683e553c3a38a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/329550
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/noder/stencil.go
src/cmd/compile/internal/reflectdata/reflect.go
test/typeparam/issue44688.go [new file with mode: 0644]