test/fixedbugs/issue22076.go
raw| 1 | // compile |
| 2 | |
| 3 | // Copyright 2017 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | // Issue 22076: Couldn't use ":=" to declare names that refer to |
| 8 | // dot-imported symbols. |
| 9 | |
| 10 | package p |
| 11 | |
| 12 | import . "bytes" |
| 13 | |
| 14 | var _ Reader // use "bytes" import |
| 15 | |
| 16 | func f1() { |
| 17 | Buffer := 0 |
| 18 | _ = Buffer |
| 19 | } |
| 20 | |
| 21 | func f2() { |
| 22 | for Buffer := range []int{} { |
| 23 | _ = Buffer |
| 24 | } |
| 25 | } |