]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: handle the (*T).M method expression with dictionaries
authorDan Scales <danscales@google.com>
Tue, 6 Jul 2021 17:53:00 +0000 (10:53 -0700)
committerDan Scales <danscales@google.com>
Wed, 7 Jul 2021 17:31:57 +0000 (17:31 +0000)
commitb4844c9f54eb6a559d8dc9333cf5b1e66dab8167
treec14c3561c5ccc3542d9b53b3761229b271aa887b
parent4676c3675e85a8a82a1513ef1f5e38aebc80ddc8
[dev.typeparams] cmd/compile: handle the (*T).M method expression with dictionaries

The (*T).M method expression is where M is a value method, but the type
(*T) is a pointer to the main type. In this case, after following any
embedded fields, we need to add an extra star operator when using the
receiver arg in the closure call.

Thanks to Cuong for finding/pointing out an example for this case
(typeparam/mdempsky/14.go) This example also shows that we now need the
ability to export/import OEFACE and OIDATA, which I added.

Change-Id: Ida0f81ce757fff78fec6276c60052ed71d207454
Reviewed-on: https://go-review.googlesource.com/c/go/+/333014
Run-TryBot: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
src/cmd/compile/internal/noder/stencil.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
test/run.go
test/typeparam/dictionaryCapture.go