summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-16 10:21:54 -0400
committerRuss Cox <rsc@golang.org>2014-09-16 10:21:54 -0400
commitf1e298b92fb8286ed1b9aa24f3cdfa5dd9e0841b (patch)
tree0e4921fe8df7a0fd267985572013a7b346fee083 /test
parent6c954a06721de39012fcba957492617e783b2d7c (diff)
downloadgo-f1e298b92fb8286ed1b9aa24f3cdfa5dd9e0841b.tar.gz
cmd/gc: say 'non-constant array bound' instead of 'invalid array bound'
Fixes issue 8196. LGTM=adonovan R=adonovan CC=golang-codereviews https://codereview.appspot.com/141510044
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug255.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/fixedbugs/bug255.go b/test/fixedbugs/bug255.go
index acf4f2391..65ed1b8f6 100644
--- a/test/fixedbugs/bug255.go
+++ b/test/fixedbugs/bug255.go
@@ -6,10 +6,15 @@
package main
-var a [10]int // ok
-var b [1e1]int // ok
-var c [1.5]int // ERROR "truncated"
-var d ["abc"]int // ERROR "invalid array bound|not numeric"
-var e [nil]int // ERROR "invalid array bound|not numeric"
-var f [e]int // ERROR "invalid array bound|not constant"
-var g [1<<65]int // ERROR "array bound is too large|overflows"
+var a [10]int // ok
+var b [1e1]int // ok
+var c [1.5]int // ERROR "truncated"
+var d ["abc"]int // ERROR "invalid array bound|not numeric"
+var e [nil]int // ERROR "invalid array bound|not numeric"
+var f [e]int // ERROR "invalid array bound|not constant"
+var g [1 << 65]int // ERROR "array bound is too large|overflows"
+var h [len(a)]int // ok
+
+func ff() string
+
+var i [len([1]string{ff()})]int // ERROR "non-constant array bound|not constant"