summaryrefslogtreecommitdiff
path: root/test/fixedbugs/bug144.go
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2009-04-24 16:43:31 -0700
committerKen Thompson <ken@golang.org>2009-04-24 16:43:31 -0700
commit12b713597eab0e9ef4bf288c8795d640d2b7d310 (patch)
treeb6a1d08f29d01534d3e2a26434f626dd2c7102ce /test/fixedbugs/bug144.go
parentca14cd095d1e7361555a43d02f71bedfe50e97b7 (diff)
downloadgo-12b713597eab0e9ef4bf288c8795d640d2b7d310.tar.gz
recognize a defined constant
as a new name in a later declaration (bug 144) R=r OCL=27850 CL=27850
Diffstat (limited to 'test/fixedbugs/bug144.go')
-rw-r--r--test/fixedbugs/bug144.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fixedbugs/bug144.go b/test/fixedbugs/bug144.go
new file mode 100644
index 000000000..916566ef0
--- /dev/null
+++ b/test/fixedbugs/bug144.go
@@ -0,0 +1,21 @@
+// $G $D/$F.go || echo BUG should compile
+
+// 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
+
+const c = 1;
+
+func main() {
+ c := 0;
+}
+
+/*
+bug144.go:8: left side of := must be a name
+bug144.go:8: operation LITERAL not allowed in assignment context
+bug144.go:8: illegal types for operand: AS
+ ideal
+ int
+*/