]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix method expression lookup during import
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 31 Aug 2021 17:18:13 +0000 (00:18 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 1 Sep 2021 02:16:30 +0000 (02:16 +0000)
commit62ba72b35321bd76de18aa8874b021ee02ab8a4e
treef2cfb58711d6159f824a7c6b1aa7eb62e9da177d
parentf4e24599dd2fe81690c6dacceec1d9336bf24c60
cmd/compile: fix method expression lookup during import

CL 309831 fixed importing of method expressions, by re-using the same
code already have for ODOTMETH. But that code does not work with
embedded field.

To fix this, we need to calculate all methods of the receiver base type
of method expression, before looking up the selection.

Fixes #48088

Change-Id: Ia244d36a3ed0f989735eb57becdfa70a81912f57
Reviewed-on: https://go-review.googlesource.com/c/go/+/346489
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/typecheck/iimport.go
test/fixedbugs/issue48088.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue48088.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue48088.go [new file with mode: 0644]