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:
parent
3d8ebefbbe
commit
a52027a491
@ -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) {}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user