3556d3b9bf
This was missed earlier, because NewConstAt is only used now to construct the predeclared "true" and "false" constants. But these constants are no longer actually accessed with unified IR. For constant expressions, types2 (and go/types) sets TypeAndValue.Value for the expression to the appropriate constant value. The unified writer recognizes when expressions are constants, and simply writes the underlying value, regardless of the original expression. As a result, we never end up actually referencing the *named* "true" and "false" constants; we just always construct anonymous constant "true" and "false" values. However, a manually constructed tree that includes an *ir.Name that "Uses" the predeclared true/false Const Objects, yet doesn't set TypeAndValue.Value will instead end up trying to use named constants constructed with NewConstAt. Thanks to Russ for reporting the issue on CL 510541, and to Cuong for identifying the fix. Change-Id: I0614105379d63ea76d7244ebd1e4db5c239d4670 Reviewed-on: https://go-review.googlesource.com/c/go/+/524357 Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
go.env | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.