mirror of
https://github.com/golang/go
synced 2024-10-14 03:43:28 +00:00
test/closure2.go: correctly "use" tmp
cmd/go doesn't complain (this is an open issue), but go/types does Change-Id: I2caec1f7aec991a9500d2c3504c29e4ab718c138 Reviewed-on: https://go-review.googlesource.com/3541 Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
27aed3ce68
commit
4a1756824f
|
@ -54,6 +54,7 @@ func main() {
|
||||||
}
|
}
|
||||||
func() {
|
func() {
|
||||||
tmp = w // force capture of w, but do not write to it yet
|
tmp = w // force capture of w, but do not write to it yet
|
||||||
|
_ = tmp
|
||||||
func() {
|
func() {
|
||||||
func() {
|
func() {
|
||||||
w++ // write in a nested closure
|
w++ // write in a nested closure
|
||||||
|
|
Loading…
Reference in a new issue