Fixes #16428.
Change-Id: I78d37472e228402bb3c06d7ebd441952386fa38a
Reviewed-on: https://go-review.googlesource.com/31731
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
if n.Left == nil {
t = typSlice(r.Type)
} else if n.Left.Op == ODDD {
- t = typDDDArray(r.Type)
- if top&Ecomplit == 0 && n.Diag == 0 {
- t.Broke = true
- n.Diag = 1
- yyerror("use of [...] array outside of array literal")
+ if top&Ecomplit == 0 {
+ if n.Diag == 0 {
+ n.Diag = 1
+ yyerror("use of [...] array outside of array literal")
+ }
+ n.Type = nil
+ return n
}
+ t = typDDDArray(r.Type)
} else {
n.Left = indexlit(typecheck(n.Left, Erv))
l := n.Left
--- /dev/null
+// errorcheck
+
+// Copyright 2016 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 p
+
+var (
+ b = [...]byte("abc") // ERROR "outside of array literal"
+ s = len(b)
+)