Skip to content

Commit 2273115

Browse files
committed
array literals not initialized
R=r DELTA=11 (11 added, 0 deleted, 0 changed) OCL=15222 CL=15276
1 parent 0a097b5 commit 2273115

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: test/bugs/bug101.go

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// $G $D/$F.go && $L $F.$A && ./$A.out
2+
3+
// Copyright 2009 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+
package main
8+
9+
var a = []int { 1, 2, 3 }
10+
11+
func main() {
12+
if len(a) != 3 { panic("array len") }
13+
// print(a[0], " ", a[1], " ", a[2], "\n")
14+
if a[0] != 1 || a[1] != 2 || a[2] != 3 { panic("array contents") }
15+
}

0 commit comments

Comments
 (0)