mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
![Keith Randall](/assets/img/avatar_default.png)
Make sure auto names don't conflict with function names. Before this CL, we confused name a.len (the len field of the slice a) with a.len (the function len declared on a). Fixes #15961 Change-Id: I14913de697b521fb35db9a1b10ba201f25d552bb Reviewed-on: https://go-review.googlesource.com/23789 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
22 lines
352 B
Go
22 lines
352 B
Go
// compile
|
|
|
|
// Copyright 2016 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package y
|
|
|
|
type symSet []int
|
|
|
|
//go:noinline
|
|
func (s symSet) len() (r int) {
|
|
return 0
|
|
}
|
|
|
|
func f(m map[int]symSet) {
|
|
var symSet []int
|
|
for _, x := range symSet {
|
|
m[x] = nil
|
|
}
|
|
}
|