mirror of
https://github.com/golang/go
synced 2024-11-23 16:30:06 -07:00
62ba72b353
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>
23 lines
285 B
Go
23 lines
285 B
Go
// Copyright 2021 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package a
|
|
|
|
type T1 struct {
|
|
*T2
|
|
}
|
|
|
|
type T2 struct {
|
|
}
|
|
|
|
func (t2 *T2) M() {
|
|
}
|
|
|
|
func F() {
|
|
f(T1.M)
|
|
}
|
|
|
|
func f(f func(T1)) {
|
|
}
|