1
0
mirror of https://github.com/golang/go synced 2024-11-24 14:50:13 -07:00
go/test/fixedbugs/issue15961.go
Keith Randall 2f088884ae cmd/compile: use fake package for allocating autos
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>
2016-06-07 06:04:23 +00:00

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
}
}