]> Cypherpunks repositories - gostls13.git/commitdiff
delete redundant bug.
authorRob Pike <r@golang.org>
Wed, 20 Aug 2008 22:46:05 +0000 (15:46 -0700)
committerRob Pike <r@golang.org>
Wed, 20 Aug 2008 22:46:05 +0000 (15:46 -0700)
fix typo.
add scoping bug.

R=gri
OCL=14349
CL=14349

test/bugs/bug091.go [new file with mode: 0644]
test/golden.out
test/iota.go
test/ken/robiota.go [deleted file]

diff --git a/test/bugs/bug091.go b/test/bugs/bug091.go
new file mode 100644 (file)
index 0000000..82391ea
--- /dev/null
@@ -0,0 +1,25 @@
+// 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
+
+func f1() {
+       exit:
+               print("hi\n");
+}
+
+func f2() {
+       const c = 1234;
+}
+
+func f3() {
+       i := c; // BUG: compiles but should not. constant is not in scope in this function
+       goto exit;      // BUG: compiles but should not. label is not in this function
+}
+
+func main() {
+       f3();
+}
index 7b3da3cdd9cb34d21e4d8b74e4f5f2d3f388ac21..df2e9b4158c9ed0e7271f1fe22a3f3319e5de401 100644 (file)
@@ -185,6 +185,9 @@ BUG: fails incorrectly
 =========== bugs/bug090.go
 BUG: compilation succeeds incorrectly
 
+=========== bugs/bug091.go
+BUG: compilation succeeds incorrectly
+
 =========== fixedbugs/bug015.go
 fixedbugs/bug015.go:7: overflow converting constant to <int64>INT64
 
index 7173d9a0e8edc14c18c519e50b2580af34b43f5c..57e6b7615e4eb5174d95b8e55ffdad1e46754f55 100644 (file)
@@ -103,5 +103,5 @@ func main() {
        assert(r == 2.0, "r");
 
        assert(s == "a", "s");
-       assert(t == "b", "s");
+       assert(t == "b", "t");
 }
diff --git a/test/ken/robiota.go b/test/ken/robiota.go
deleted file mode 100644 (file)
index af97fa2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// 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.
-
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-package main
-
-func assert(cond bool, msg string) {
-       if !cond {
-               print("assertion fail: " + msg + "\n");
-               panic(1);
-       }
-}
-
-const (
-       x int = iota;
-       y = iota;
-       z = 1 << iota;
-       f float = 2 * iota;
-       g float = 4.5 * float(iota);
-);
-
-func main() {
-       assert(x == 0, "x");
-       assert(y == 1, "y");
-       assert(z == 4, "z");
-       assert(f == 6.0, "f");
-       assert(g == 18.0, "g");
-}