test/fixedbugs/issue4495.go
raw| 1 | // run |
| 2 | |
| 3 | // Copyright 2012 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | package main |
| 8 | |
| 9 | type I interface { |
| 10 | m() int |
| 11 | } |
| 12 | |
| 13 | type T struct{} |
| 14 | |
| 15 | func (T) m() int { |
| 16 | return 3 |
| 17 | } |
| 18 | |
| 19 | var t T |
| 20 | |
| 21 | var ret = I.m(t) |
| 22 | |
| 23 | func main() { |
| 24 | if ret != 3 { |
| 25 | println("ret = ", ret) |
| 26 | panic("ret != 3") |
| 27 | } |
| 28 | } |
| 29 |