Source file test/interface/embed1.dir/embed0.go

     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 p
     8  
     9  type T int
    10  
    11  func (t T) m() {}
    12  
    13  type I interface{ m() }
    14  type J interface{ I }
    15  
    16  func main() {
    17  	var i I
    18  	var j J
    19  	var t T
    20  	i = t
    21  	j = t
    22  	_ = i
    23  	_ = j
    24  	i = j
    25  	_ = i
    26  	j = i
    27  	_ = j
    28  }
    29  

View as plain text