Commit a52027a4 authored by Nigel Tao's avatar Nigel Tao

fix: walk ast.Ellipsis values.

Fixes #2583.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5671078
parent 3d8ebefb
...@@ -42,6 +42,10 @@ func g() { ...@@ -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() { ...@@ -59,6 +63,10 @@ func g() {
error := 1 error := 1
_ = error _ = error
} }
func h(error) {}
func i(...error) {}
`, `,
}, },
{ {
......
...@@ -113,6 +113,7 @@ func walkBeforeAfter(x interface{}, before, after func(interface{})) { ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment