apidiff: require exported old types to match same-named type in new Previously, correspondence was sometimes established between completely unrelated types. This CL tightens the requirements for two exported types to correspond: the only possibilities are that they have the same name, or the new type is an alias for the old. Examples: old: type T int new: type T int same name: the T's correspond old: type T int new: type T = U; type U int different name, but T is an alias for U. This might seem to exclude another case: old: type T = U; type U int new: type U int It seems that T should correspond to U even though the above conditions aren't met. But in fact U corresponds to U here, not T. Correspondence is 1:1; we pick the closest match. This may seem unrelated to the new test case, which reports that two struct fields are incompatible instead of just one. But the reason that the old code didn't report one of the fields is that it established a correspondence between the fields' types, despite their being completely unrelated. Fixes golang/go#81523. Change-Id: I8ab02d13acb606d4ea26fc73fa4d7ee5042d18d7 Reviewed-on: https://go-review.googlesource.com/c/exp/+/836046 Reviewed-by: Hongxiang Jiang <hxjiang@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This subrepository holds experimental and deprecated (in the old directory) packages.
The idea for this subrepository originated as the pkg/exp directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)
Caveat emptor.