2012-02-16 21:49:30 -07:00
|
|
|
// errorcheck
|
2009-12-15 17:22:04 -07:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
2009-12-15 17:22:04 -07: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 09:14:26 -06:00
|
|
|
i = t // ERROR "not a method|has no methods" "does not implement I"
|
2009-12-15 17:22:04 -07:00
|
|
|
_ = i
|
|
|
|
}
|