1
0
mirror of https://github.com/golang/go synced 2024-11-22 09:44:40 -07:00
go/test/fixedbugs/issue4326.go
Russ Cox cb856adea9 cmd/gc: annotate local variables with unique ids for inlining
Avoids problems with local declarations shadowing other names.
We write a more explicit form than the incoming program, so there
may be additional type annotations. For example:

        int := "hello"
        j := 2

would normally turn into

        var int string = "hello"
        var j int = 2

but the int variable shadows the int type in the second line.

This CL marks all local variables with a per-function sequence number,
so that this would instead be:

        var int·1 string = "hello"
        var j·2 int = 2

Fixes #4326.

R=ken2
CC=golang-dev
https://golang.org/cl/6816100
2012-11-07 09:59:19 -05:00

10 lines
254 B
Go

// compiledir
// Copyright 2012 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.
// Printing local variables in inliner shadows global names.
package ignored