1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:14:40 -07:00

gc: bug280

Fixes #808.

R=ken2
CC=golang-dev
https://golang.org/cl/1273042
This commit is contained in:
Russ Cox 2010-05-24 15:25:09 -07:00
parent c95e11db56
commit 43c0a46ac6
2 changed files with 15 additions and 0 deletions

View File

@ -239,6 +239,8 @@ dowidth(Type *t)
w = sizeof_Array;
checkwidth(t->type);
}
else if(t->bound == -100)
yyerror("use of [...] array outside of array literal");
else
fatal("dowidth %T", t); // probably [...]T
break;

13
test/fixedbugs/bug280.go Normal file
View File

@ -0,0 +1,13 @@
// errchk $G $D/$F.go
// Copyright 2010 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.
// http://code.google.com/p/go/issues/detail?id=808
package main
type A [...]int // ERROR "outside of array literal"