2012-02-17 04:49:30 +00:00
|
|
|
// errorcheck
|
2009-12-16 00:22:04 +00:00
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
2009-12-16 00:22:04 +00:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type I interface { m() }
|
|
|
|
type T struct { m func() }
|
|
|
|
type M struct {}
|
|
|
|
func (M) m() {}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
var t T
|
|
|
|
var m M
|
|
|
|
var i I
|
|
|
|
|
|
|
|
i = m
|
2011-08-16 15:14:26 +00:00
|
|
|
i = t // ERROR "not a method|has no methods" "does not implement I"
|
2009-12-16 00:22:04 +00:00
|
|
|
_ = i
|
|
|
|
}
|