mirror of
https://github.com/golang/go
synced 2024-11-13 20:10:32 -07:00
12ee55ba7b
Historically, inline function bodies were exported as plain Go source code, and symbol mangling was a convenient hack because it allowed variables to be re-imported with largely the same names as they were originally exported as. However, nowadays we use a binary format that's more easily extended, so we can simply serialize all of a function's declared objects up front, and then refer to them by index later on. This also allows us to easily report unmangled names all the time (e.g., error message from issue7921.go). Fixes #43633. Change-Id: I46c88f5a47cb921f70ab140976ba9ddce38df216 Reviewed-on: https://go-review.googlesource.com/c/go/+/283193 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com> Trust: Dan Scales <danscales@google.com> Trust: Matthew Dempsky <mdempsky@google.com>
29 lines
378 B
Go
29 lines
378 B
Go
// Copyright 2021 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 a
|
|
|
|
func F() bool {
|
|
{
|
|
x := false
|
|
_ = x
|
|
}
|
|
if false {
|
|
_ = func(x bool) {}
|
|
}
|
|
x := true
|
|
return x
|
|
}
|
|
|
|
func G() func() bool {
|
|
x := true
|
|
return func() bool {
|
|
{
|
|
x := false
|
|
_ = x
|
|
}
|
|
return x
|
|
}
|
|
}
|