]> Cypherpunks repositories - gostls13.git/commitdiff
Bug in go/parser when coverting identifier lists.
authorRobert Griesemer <gri@golang.org>
Tue, 26 Jan 2010 19:41:38 +0000 (11:41 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 26 Jan 2010 19:41:38 +0000 (11:41 -0800)
Fixes #567.

R=rsc
CC=golang-dev
https://golang.org/cl/195041

src/pkg/go/parser/parser.go
src/pkg/go/parser/parser_test.go

index ef610209e81d53b6707def7366e707fc2b9944e8..45713327df5607fef4689cd1ad1a43e2f9384d5e 100644 (file)
@@ -464,7 +464,7 @@ func (p *parser) makeIdentList(list *vector.Vector) []*ast.Ident {
                if !isIdent {
                        pos := x.(ast.Expr).Pos()
                        p.errorExpected(pos, "identifier")
-                       idents[i] = &ast.Ident{pos, ast.NewObj(ast.Err, pos, "")}
+                       ident = &ast.Ident{pos, ast.NewObj(ast.Err, pos, "_")}
                }
                idents[i] = ident
        }
index 9e37551623fa5f1b15c33db62afed97715b7bcc2..c177b2eb816aed43ec9a76ce79bf930efb001dec 100644 (file)
@@ -34,6 +34,7 @@ var validPrograms = []interface{}{
        `package main; func main() { if f(T{}) {} }` + "\n",
        `package main; func main() { _ = (<-chan int)(x) }` + "\n",
        `package main; func main() { _ = (<-chan <-chan int)(x) }` + "\n",
+       `package main; func f(func() (func() int))` + "\n",
 }