summaryrefslogtreecommitdiff
path: root/src/cmd/fix
diff options
context:
space:
mode:
authorNigel Tao <nigeltao@golang.org>2012-02-17 14:39:50 +1100
committerNigel Tao <nigeltao@golang.org>2012-02-17 14:39:50 +1100
commit782ca11ca1dfbfc9074e8ac1cfdca9b58a741569 (patch)
tree69587e786d61d4089f694fc4e511da3f5433e0dc /src/cmd/fix
parentb74806104780b6bd018a04647ab4565e3e07207d (diff)
downloadgo-782ca11ca1dfbfc9074e8ac1cfdca9b58a741569.tar.gz
fix: walk ast.Ellipsis values.
Fixes issue 2583. R=rsc, r CC=golang-dev http://codereview.appspot.com/5671078
Diffstat (limited to 'src/cmd/fix')
-rw-r--r--src/cmd/fix/error_test.go8
-rw-r--r--src/cmd/fix/fix.go1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/fix/error_test.go b/src/cmd/fix/error_test.go
index eeab7e2ee..027eed24f 100644
--- a/src/cmd/fix/error_test.go
+++ b/src/cmd/fix/error_test.go
@@ -42,6 +42,10 @@ func g() {
error := 1
_ = error
}
+
+func h(os.Error) {}
+
+func i(...os.Error) {}
`,
Out: `package main
@@ -59,6 +63,10 @@ func g() {
error := 1
_ = error
}
+
+func h(error) {}
+
+func i(...error) {}
`,
},
{
diff --git a/src/cmd/fix/fix.go b/src/cmd/fix/fix.go
index d2067cb51..a100be794 100644
--- a/src/cmd/fix/fix.go
+++ b/src/cmd/fix/fix.go
@@ -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)