Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / go.test / test / interface / embed1.go
blob24e50471f2d43440d5e7c294c1fd1242fc71d08d
1 // $G $D/embed0.go && $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 that embedded interface types can have local methods.
9 package main
11 import "./embed0"
13 type T int
14 func (t T) m() {}
16 type I interface { m() }
17 type J interface { I }
19 type PI interface { p.I }
20 type PJ interface { p.J }
22 func main() {
23 var i I
24 var j J
25 var t T
26 i = t
27 j = t
28 _ = i
29 _ = j
30 i = j
31 _ = i
32 j = i
33 _ = j
34 var pi PI
35 var pj PJ
36 var pt p.T
37 pi = pt
38 pj = pt
39 _ = pi
40 _ = pj
41 pi = pj
42 _ = pi
43 pj = pi
44 _ = pj