1
0
mirror of https://github.com/golang/go synced 2024-11-25 13:27:57 -07:00

fix: walk ast.Ellipsis values.

Fixes #2583.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5671078
This commit is contained in:
Nigel Tao 2012-02-17 14:39:50 +11:00
parent 3d8ebefbbe
commit a52027a491
2 changed files with 9 additions and 0 deletions

View File

@ -42,6 +42,10 @@ func g() {
error := 1 error := 1
_ = error _ = error
} }
func h(os.Error) {}
func i(...os.Error) {}
`, `,
Out: `package main Out: `package main
@ -59,6 +63,10 @@ func g() {
error := 1 error := 1
_ = error _ = error
} }
func h(error) {}
func i(...error) {}
`, `,
}, },
{ {

View File

@ -113,6 +113,7 @@ func walkBeforeAfter(x interface{}, before, after func(interface{})) {
case *ast.BadExpr: case *ast.BadExpr:
case *ast.Ident: case *ast.Ident:
case *ast.Ellipsis: case *ast.Ellipsis:
walkBeforeAfter(&n.Elt, before, after)
case *ast.BasicLit: case *ast.BasicLit:
case *ast.FuncLit: case *ast.FuncLit:
walkBeforeAfter(&n.Type, before, after) walkBeforeAfter(&n.Type, before, after)