2015-02-14 05:31:30 +03:00
|
|
|
// errorcheck
|
|
|
|
|
2016-04-11 00:32:26 +03:00
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
2015-02-14 05:31:30 +03:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Test that fields hide promoted methods.
|
2015-07-11 02:17:11 +03:00
|
|
|
// https://golang.org/issue/4365
|
2015-02-14 05:31:30 +03:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type T interface {
|
|
|
|
M()
|
|
|
|
}
|
|
|
|
|
|
|
|
type M struct{}
|
|
|
|
|
|
|
|
func (M) M() {}
|
|
|
|
|
|
|
|
type Foo struct {
|
|
|
|
M
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
var v T = Foo{} // ERROR "has no methods|not a method|cannot use"
|
|
|
|
_ = v
|
|
|
|
}
|