1
0
mirror of https://github.com/golang/go synced 2024-11-25 05:38:01 -07:00

Replacement for abandoned CL 29626:

bug157 and bug158

R=rsc
DELTA=59  (59 added, 0 deleted, 0 changed)
OCL=29632
CL=29634
This commit is contained in:
Robert Griesemer 2009-05-29 16:43:24 -07:00
parent d83dc4f5c6
commit 705f9af38e
3 changed files with 67 additions and 0 deletions

32
test/bugs/bug157.go Normal file
View File

@ -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
*/

26
test/bugs/bug158.go Normal file
View File

@ -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
*/

View 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