1 // $G $D/$F.go && $L $F.$A && ./$A.out
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 // Check uses of all the different interface
8 // conversion runtime functions.
12 type Stringer interface {
15 type StringLengther interface {
19 type Empty interface{}
23 func (t T) String() string {
26 func (t T) Length() int {
32 func (u U) String() string {
40 var sl StringLengther = t
44 func hello(s string) {
46 println("not hello: ", s)
96 sl = s.(StringLengther)
102 hello(e.(T).String())
118 sl, ok = s.(StringLengther)
123 // I2I2 false (and T2I)
125 sl, ok = s.(StringLengther)
138 sl, ok = e.(StringLengther)
143 // E2I2 false (and T2E)
145 sl, ok = e.(StringLengther)