mirror of
https://github.com/golang/go
synced 2024-11-22 02:54:39 -07:00
5f172fadbe
The spec says that all methods are inherited from an anonymous field. There is no exception for non-exported methods. This is related to issue 1536. R=rsc CC=golang-dev https://golang.org/cl/5012043
17 lines
149 B
Go
17 lines
149 B
Go
package p
|
|
|
|
type T struct{ x int }
|
|
type S struct{}
|
|
|
|
func (p *S) get() T {
|
|
return T{0}
|
|
}
|
|
|
|
type I interface {
|
|
get() T
|
|
}
|
|
|
|
func F(i I) {
|
|
_ = i.get()
|
|
}
|