3 // Copyright 2009 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.
7 // Test all the different interface conversion runtime functions.
11 type Stringer interface {
14 type StringLengther interface {
18 type Empty interface{}
22 func (t T) String() string {
25 func (t T) Length() int {
31 func (u U) String() string {
39 var sl StringLengther = t
43 func hello(s string) {
45 println("not hello: ", s)
95 sl = s.(StringLengther)
101 hello(e.(T).String())
117 sl, ok = s.(StringLengther)
122 // I2I2 false (and T2I)
124 sl, ok = s.(StringLengther)
137 sl, ok = e.(StringLengther)
142 // E2I2 false (and T2E)
144 sl, ok = e.(StringLengther)