mirror of
https://github.com/golang/go
synced 2024-11-26 03:57:57 -07: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() {
|
||||
tmp = w // force capture of w, but do not write to it yet
|
||||
_ = tmp
|
||||
func() {
|
||||
func() {
|
||||
w++ // write in a nested closure
|
||||
|
Loading…
Reference in New Issue
Block a user