Skip to content

Commit

Permalink
fix: walk ast.Ellipsis values.
Browse files Browse the repository at this point in the history
Fixes #2583.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5671078
  • Loading branch information
nigeltao committed Feb 17, 2012
1 parent 3d8ebef commit a52027a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cmd/fix/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func g() {
error := 1
_ = error
}
func h(os.Error) {}
func i(...os.Error) {}
`,
Out: `package main
Expand All @@ -59,6 +63,10 @@ func g() {
error := 1
_ = error
}
func h(error) {}
func i(...error) {}
`,
},
{
Expand Down
1 change: 1 addition & 0 deletions src/cmd/fix/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func walkBeforeAfter(x interface{}, before, after func(interface{})) {
case *ast.BadExpr:
case *ast.Ident:
case *ast.Ellipsis:
walkBeforeAfter(&n.Elt, before, after)
case *ast.BasicLit:
case *ast.FuncLit:
walkBeforeAfter(&n.Type, before, after)
Expand Down

0 comments on commit a52027a

Please sign in to comment.