OLD | NEW |
1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug196 | 1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug196 |
2 | 2 |
3 // Copyright 2009 The Go Authors. All rights reserved. | 3 // Copyright 2009 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
6 | 6 |
7 package main | 7 package main |
8 | 8 |
9 var m = map[int]int{0: 0, 1: 0} | 9 var m = map[int]int{0: 0, 1: 0} |
10 var nf = 0 | 10 var nf = 0 |
11 var i int | 11 var i int |
12 | 12 |
13 func multi() (int, int) { return 1, 2 } | 13 func multi() (int, int) { return 1, 2 } |
14 | 14 |
15 func xxx() { | 15 func xxx() { |
16 » //TODO(rsc): uncomment when this syntax is valid for receive+check close
d | 16 » var c chan int |
17 » //» var c chan int | 17 » x, ok := <-c |
18 » //» x, ok := <-c | |
19 | 18 |
20 var m map[int]int | 19 var m map[int]int |
21 » x, ok := m[1] | 20 » x, ok = m[1] |
22 | 21 |
23 var i interface{} | 22 var i interface{} |
24 var xx int | 23 var xx int |
25 xx, ok = i.(int) | 24 xx, ok = i.(int) |
26 | 25 |
27 a, b := multi() | 26 a, b := multi() |
28 | 27 |
29 _, _, _, _, _ = x, ok, xx, a, b | 28 _, _, _, _, _ = x, ok, xx, a, b |
30 } | 29 } |
31 | 30 |
(...skipping 10 matching lines...) Expand all Loading... |
42 func main() { | 41 func main() { |
43 f()[0]++ | 42 f()[0]++ |
44 f()[1] += 2 | 43 f()[1] += 2 |
45 *g() %= 2 | 44 *g() %= 2 |
46 if nf != 3 { | 45 if nf != 3 { |
47 println("too many calls:", nf) | 46 println("too many calls:", nf) |
48 panic("fail") | 47 panic("fail") |
49 } | 48 } |
50 | 49 |
51 } | 50 } |
OLD | NEW |