github.com/xushiwei/go@v0.0.0-20130601165731-2b9d83f45bc9/test/fixedbugs/bug406.go (about)

     1  // run
     2  
     3  // Copyright 2012 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  // Issue 2821
     8  package main
     9  
    10  type matrix struct {
    11  	e []int
    12  }
    13  
    14  func (a matrix) equal() bool {
    15  	for _ = range a.e {
    16  	}
    17  	return true
    18  }
    19  
    20  func main() {
    21  	var a matrix
    22  	var i interface{}
    23  	i = true && a.equal()
    24  	_ = i
    25  }