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.
22 func (this *S) f()int {
26 func (this *S) g()int {
41 if s.f() != 5 { panic(11); }
42 if s.g() != 6 { panic(12); }
44 i1 = s; // convert S to I1
45 i2 = i1.(I2); // convert I1 to I2
48 if i1.f() != 5 { panic(21); }
49 if i2.f() != 5 { panic(22); }
50 if i2.g() != 6 { panic(23); }
52 g = i1.(*S); // convert I1 to S
53 if g != s { panic(31); }
55 g = i2.(*S); // convert I2 to S
56 if g != s { panic(32); }