From: Robert Griesemer Date: Thu, 19 Nov 2009 08:04:30 +0000 (-0800) Subject: bug219: parsing difficulties with 6g X-Git-Tag: weekly.2009-12-07~197 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5fd4f768029cd8f84063d08e4a7787689ab6c09b;p=gostls13.git bug219: parsing difficulties with 6g R=r, rsc https://golang.org/cl/157085 --- diff --git a/test/bugs/bug219.go b/test/bugs/bug219.go new file mode 100644 index 0000000000..aee07cce7e --- /dev/null +++ b/test/bugs/bug219.go @@ -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 { + } +} diff --git a/test/golden.out b/test/golden.out index 8a1c3af59b..64bfd6ecc7 100644 --- a/test/golden.out +++ b/test/golden.out @@ -145,3 +145,7 @@ panic PC=xxx =========== bugs/bug218.go : fatal error: dowidth: unknown type: blank BUG: bug218 + +=========== bugs/bug219.go +bugs/bug219.go:16: syntax error near if +BUG: bug219