blob: 32cf3e35d278e58be97176f45223762102887f70 [file] [log] [blame]
Rémy Oudompheng2ece2f52012-02-18 22:15:42 +01001// run
Luuk van Dijk5efd5622012-02-06 15:41:01 +01002
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07003// Copyright 2012 The Go Authors. All rights reserved.
Luuk van Dijk5efd5622012-02-06 15:41:01 +01004// 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
8package main
9
10type matrix struct {
11 e []int
12}
13
14func (a matrix) equal() bool {
15 for _ = range a.e {
16 }
Russ Cox8d504c42014-07-16 19:27:10 -040017 for range a.e {
18 }
Luuk van Dijk5efd5622012-02-06 15:41:01 +010019 return true
20}
21
22func main() {
23 var a matrix
24 var i interface{}
25 i = true && a.equal()
26 _ = i
27}