]> Cypherpunks repositories - gostls13.git/commitdiff
bug219: parsing difficulties with 6g
authorRobert Griesemer <gri@golang.org>
Thu, 19 Nov 2009 08:04:30 +0000 (00:04 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 19 Nov 2009 08:04:30 +0000 (00:04 -0800)
R=r, rsc
https://golang.org/cl/157085

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

diff --git a/test/bugs/bug219.go b/test/bugs/bug219.go
new file mode 100644 (file)
index 0000000..aee07cc
--- /dev/null
@@ -0,0 +1,35 @@
+// $G $D/$F.go || echo BUG: bug219
+
+// 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()) int { return 0 }
+
+// this doesn't work:
+// bug219.go:16: syntax error near if
+func g1() {
+       if x := f(func() {
+               if {}
+       }); {
+       }
+}
+
+// this works
+func g2() {
+       if x := f(func() {
+               //if {}
+       }); {
+       }
+}
+
+// this works
+func g3() {
+       x := f(func() {
+               if {}
+       });
+       if {
+       }
+}
index 8a1c3af59b8697b4bac10a7d7a0896237373ce56..64bfd6ecc7b40bc4ae8deb7efa8ea29accd71dbb 100644 (file)
@@ -145,3 +145,7 @@ panic PC=xxx
 =========== bugs/bug218.go
 <epoch>: fatal error: dowidth: unknown type: blank
 BUG: bug218
+
+=========== bugs/bug219.go
+bugs/bug219.go:16: syntax error near if
+BUG: bug219