]> Cypherpunks repositories - gostls13.git/commitdiff
Replacement for abandoned CL 29626:
authorRobert Griesemer <gri@golang.org>
Fri, 29 May 2009 23:43:24 +0000 (16:43 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 29 May 2009 23:43:24 +0000 (16:43 -0700)
bug157 and bug158

R=rsc
DELTA=59  (59 added, 0 deleted, 0 changed)
OCL=29632
CL=29634

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

diff --git a/test/bugs/bug157.go b/test/bugs/bug157.go
new file mode 100644 (file)
index 0000000..207f6bc
--- /dev/null
@@ -0,0 +1,32 @@
+// $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
+
+func f() {}
+
+func main() {
+       x := 0;
+
+       // this compiles
+       switch x {
+       case 0: f();
+       default: f();
+       }
+
+       // this doesn't but it should
+       // (semicolons are not needed at the end of a statement list)
+       switch x {
+       case 0: f()
+       default: f()
+       }
+}
+
+
+/*
+bug155.go:20: syntax error near default
+bug155.go:20: first switch statement must be a case
+*/
diff --git a/test/bugs/bug158.go b/test/bugs/bug158.go
new file mode 100644 (file)
index 0000000..a40bf82
--- /dev/null
@@ -0,0 +1,26 @@
+// $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
+
+func main() {
+       x := 0;
+
+       // this compiles
+       switch x {
+       case 0:
+       }
+
+       // this doesn't but should
+       switch 0 {
+       case 0:
+       }
+}
+
+
+/*
+bug156.go:14: fatal error: dowidth: unknown type: E-33
+*/
index b5dbddffe62148ed9bdc8144bd8d87d63cbc7e5f..13c83aa80d3a56fd3d881000fe476857fda9cbdf 100644 (file)
@@ -104,6 +104,15 @@ BUG should compile
 5 7
 BUG: should crash
 
+=========== bugs/bug157.go
+bugs/bug157.go:20: syntax error near default
+bugs/bug157.go:20: first switch statement must be a case
+BUG: should compile
+
+=========== bugs/bug158.go
+bugs/bug158.go:14: fatal error: dowidth: unknown type: E-33
+BUG: should compile
+
 =========== fixedbugs/bug016.go
 fixedbugs/bug016.go:7: constant -3 overflows uint