spec and implementation disagree with respect to label declarations

R=rsc
DELTA=19  (19 added, 0 deleted, 0 changed)
OCL=26284
CL=26336
This commit is contained in:
Robert Griesemer 2009-03-16 11:21:58 -07:00
parent ec77e75e5d
commit 5a27079801
2 changed files with 23 additions and 0 deletions

18
test/bugs/bug140.go Normal file
View file

@ -0,0 +1,18 @@
// $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() {
if {} else L: ;
if {} else L: main() ;
}
/*
These should be legal according to the spec.
bug140.go:6: syntax error near L
bug140.go:7: syntax error near L
*/

View file

@ -136,6 +136,11 @@ bugs/bug139.go:7: fatal error: naddr: ONAME class x 5
BUG should compile
=========== bugs/bug140.go
bugs/bug140.go:6: syntax error near L
bugs/bug140.go:7: syntax error near L
BUG should compile
=========== fixedbugs/bug016.go
fixedbugs/bug016.go:7: constant -3 overflows uint