mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: fix TestUnifiedCompare
We need to start the capture walk from expr.Body, not expr, otherwise in quirks mode we'll set all of the captured variables' positions to expr.Body.Rbrace. Change-Id: Ic93f2773ae3756c2ec88dac17b4e9fb5a0771734 Reviewed-on: https://go-review.googlesource.com/c/go/+/330889 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
f4198f85d5
commit
9fe7c38d3d
1 changed files with 1 additions and 1 deletions
|
|
@ -1281,7 +1281,7 @@ func (w *writer) captureVars(expr *syntax.FuncLit) (closureVars []posObj, locals
|
||||||
localsIdx: make(map[types2.Object]int),
|
localsIdx: make(map[types2.Object]int),
|
||||||
}
|
}
|
||||||
|
|
||||||
syntax.Walk(expr, &v)
|
syntax.Walk(expr.Body, &v)
|
||||||
|
|
||||||
return v.closureVars, v.localsIdx
|
return v.closureVars, v.localsIdx
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue