]> Cypherpunks repositories - gostls13.git/commitdiff
bug: constants should not be redeclarable
authorRobert Griesemer <gri@golang.org>
Tue, 2 Dec 2008 01:27:57 +0000 (17:27 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 2 Dec 2008 01:27:57 +0000 (17:27 -0800)
R=rsc
DELTA=9  (9 added, 0 deleted, 0 changed)
OCL=20187
CL=20187

test/bugs/bug126.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug126.go b/test/bugs/bug126.go
new file mode 100644 (file)
index 0000000..2481e1d
--- /dev/null
@@ -0,0 +1,10 @@
+// errchk $G $D/$F.go
+
+// 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 none = 0  // same const identifier declared twice should not be accepted
+const none = 1  // ERROR "redeclared"
index 957aa86e7f7ebd4a65f656cf3ff8f8156701d82e..fe10981df5e647a3a1d33cef16d9ad918f8d33b6 100644 (file)
@@ -173,6 +173,9 @@ BUG: errchk: command succeeded unexpectedly:  6g bugs/bug124.go
 =========== bugs/bug125.go
 BUG: errchk: command succeeded unexpectedly:  6g bugs/bug125.go
 
+=========== bugs/bug126.go
+BUG: errchk: command succeeded unexpectedly:  6g bugs/bug126.go
+
 =========== fixedbugs/bug016.go
 fixedbugs/bug016.go:7: overflow converting constant to uint