]> Cypherpunks repositories - gostls13.git/commitdiff
fix: walk ast.Ellipsis values.
authorNigel Tao <nigeltao@golang.org>
Fri, 17 Feb 2012 03:39:50 +0000 (14:39 +1100)
committerNigel Tao <nigeltao@golang.org>
Fri, 17 Feb 2012 03:39:50 +0000 (14:39 +1100)
Fixes #2583.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5671078

src/cmd/fix/error_test.go
src/cmd/fix/fix.go

index eeab7e2ee150cdfa3b3d8a60a27bf8bd268789da..027eed24f8c0e59d326edfd3363ada8659caef0c 100644 (file)
@@ -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) {}
 `,
        },
        {
index d2067cb51ec0cb5dac85a740763e4ea6ddf91f6d..a100be794e2d8d6159f7f02d7b0b020dbb646cb8 100644 (file)
@@ -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)