]> Cypherpunks repositories - gostls13.git/commitdiff
- duplicate struct field not diagnosed
authorRobert Griesemer <gri@golang.org>
Wed, 21 Jan 2009 22:11:54 +0000 (14:11 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 21 Jan 2009 22:11:54 +0000 (14:11 -0800)
R=rsc
DELTA=16  (16 added, 0 deleted, 0 changed)
OCL=23224
CL=23229

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

diff --git a/test/bugs/bug132.go b/test/bugs/bug132.go
new file mode 100644 (file)
index 0000000..958db9d
--- /dev/null
@@ -0,0 +1,17 @@
+// 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
+
+type T struct {
+       x, x int  // this should be a compile-time error
+}
+
+/*
+Accessing obj.x for obj of type T will lead to an error so this cannot
+be used in a program, but I would argue that this should be a compile-
+tume error at the declaration point.
+*/
index ac8c788b077f52465c3fec752290f122e4d3145c..889b421818a5bd050b303e4f82641b110d9f46e5 100644 (file)
@@ -146,6 +146,9 @@ BUG: should run
 =========== bugs/bug131.go
 BUG: should not compile
 
+=========== bugs/bug132.go
+BUG: compilation succeeds incorrectly
+
 =========== fixedbugs/bug016.go
 fixedbugs/bug016.go:7: overflow converting constant to uint