1
0
mirror of https://github.com/golang/go synced 2024-11-21 18:14:42 -07:00

Bug in go/parser when coverting identifier lists.

Fixes #567.

R=rsc
CC=golang-dev
https://golang.org/cl/195041
This commit is contained in:
Robert Griesemer 2010-01-26 11:41:38 -08:00
parent 7abb4b3a96
commit 70b92ddad3
2 changed files with 2 additions and 1 deletions

View 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
}

View 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",
}