OSDN Git Service

Update to current version of Go library.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / go.test / test / interface / embed0.go
1 // true # used by embed1.go
2
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.
6
7 // Check that embedded interface types can have local methods.
8
9 package p
10
11 type T int
12 func (t T) m() {}
13
14 type I interface { m() }
15 type J interface { I }
16
17 func main() {
18         var i I
19         var j J
20         var t T
21         i = t
22         j = t
23         _ = i
24         _ = j
25         i = j
26         _ = i
27         j = i
28         _ = j
29 }