commit | b7d097a4cf6b8a9125e4770b54d33826fa803023 | [log] [tgz] |
---|---|---|
author | Matthew Dempsky <mdempsky@google.com> | Thu Nov 07 15:54:59 2019 -0800 |
committer | Matthew Dempsky <mdempsky@google.com> | Fri Nov 08 21:27:51 2019 +0000 |
tree | 36da83b8721e312a683876951cc897b85aafa5bf | |
parent | 9ee6ba089dc9dd2402bccd9ed28b07140f76de15 [diff] |
cmd/compile: don't apply -lang=go1.X restrictions to imported packages Previously langSupported applied -lang as though it's a global restriction, but it's actually a per-package restriction. This CL fixes langSupported to take a *types.Pkg parameter to reflect this and updates its callers accordingly. This is relevant for signed shifts (added in Go 1.12), because they can be inlined into a Go 1.11 package; and for overlapping interfaces (added in Go 1.13), because they can be exported as part of the package's API. Today we require all Go packages to be compiled with the same toolchain, and all uses of langSupported are for controlling backwards-compatible features. So we can simply assume that since the imported packages type-checked successfully, they must have been compiled with an appropriate -lang setting. In the future if we ever want to use langSupported to control backwards-incompatible language changes, we might need to record the -lang flag used for compiling a package in its export data. Fixes #35437. Fixes #35442. Change-Id: Ifdf6a62ee80cd5fb4366cbf12933152506d1b36e Reviewed-on: https://go-review.googlesource.com/c/go/+/205977 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
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 3.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.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.