| // Copyright 2009 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Test methods derived from embedded interface and *interface values. |
| func (t T) M() int64 { return int64(t) } |
| type SP struct{ *Inter } // ERROR "interface" |
| func check(s string, v int64) { |
| check("pti.M()", pti.M()) // ERROR "pointer to interface, not interface" |
| check("i = t; i.M()", i.M()) |
| check("i = t; pi.M()", pi.M()) // ERROR "pointer to interface, not interface" |
| check("i = pt; i.M()", i.M()) |
| check("i = pt; pi.M()", pi.M()) // ERROR "pointer to interface, not interface" |
| check("i = s; i.M()", i.M()) |
| check("i = s; pi.M()", pi.M()) // ERROR "pointer to interface, not interface" |
| check("i = ps; i.M()", i.M()) |
| check("i = ps; pi.M()", pi.M()) // ERROR "pointer to interface, not interface" |
| println("BUG: interface10") |