if(t->type == T)
break;
dowidth(t->type);
- w = sizeof_Array;
if(t->bound >= 0)
w = t->bound * t->type->width;
+ else if(t->bound == -1)
+ w = sizeof_Array;
+ else
+ fatal("dowidth %T", t); // probably [...]T
break;
case TSTRUCT:
case TARRAY:
if(t->bound >= 0)
return fmtprint(fp, "[%d]%T", (int)t->bound, t->type);
+ if(t->bound == -100)
+ return fmtprint(fp, "[...]%T", t->type);
return fmtprint(fp, "[]%T", t->type);
case TINTER:
n->type = t;
n->left = N;
n->right = N;
- checkwidth(t);
+ if(t->bound != -100)
+ checkwidth(t);
break;
case OTMAP:
--- /dev/null
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should run
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+func f() {
+ v := [...]string{"a", "b"};
+}
+func main() {
+ f();
+}
+
+
+
\ No newline at end of file
--- /dev/null
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+var s [8]string
+
+func
+init()
+{
+ s = [...]string{ "now", "is", "the", "time", "to", "fix", "this", "bug"}
+}
+
+func
+main()
+{
+}