~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to test/interface/embed1.dir/embed1.go

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2009 The Go Authors. All rights reserved.
 
2
// Use of this source code is governed by a BSD-style
 
3
// license that can be found in the LICENSE file.
 
4
 
 
5
// Test that embedded interface types can have local methods.
 
6
 
 
7
package main
 
8
 
 
9
import "./embed0"
 
10
 
 
11
type T int
 
12
func (t T) m() {}
 
13
 
 
14
type I interface { m() }
 
15
type J interface { I }
 
16
 
 
17
type PI interface { p.I }
 
18
type PJ interface { p.J }
 
19
 
 
20
func main() {
 
21
        var i I
 
22
        var j J
 
23
        var t T
 
24
        i = t
 
25
        j = t
 
26
        _ = i
 
27
        _ = j
 
28
        i = j
 
29
        _ = i
 
30
        j = i
 
31
        _ = j
 
32
        var pi PI
 
33
        var pj PJ
 
34
        var pt p.T
 
35
        pi = pt
 
36
        pj = pt
 
37
        _ = pi
 
38
        _ = pj
 
39
        pi = pj
 
40
        _ = pi
 
41
        pj = pi
 
42
        _ = pj
 
43
}