1
0
mirror of https://github.com/golang/go synced 2024-11-14 06:50:21 -07:00
go/test/bugs/bug157.go
Robert Griesemer 705f9af38e Replacement for abandoned CL 29626:
bug157 and bug158

R=rsc
DELTA=59  (59 added, 0 deleted, 0 changed)
OCL=29632
CL=29634
2009-05-29 16:43:24 -07:00

33 lines
556 B
Go

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