-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apidiff: fix comparison of named types in other packages
Compare named types from packages other than old and new using their package-qualified names. When determining whether two such types corresponded, we were using the IDs of the types. This was wrong, because the ID for an exported type is just its name, unqualified. The full story is a bit more subtle, because when comparing modules, we want to allow for the module paths to be different. That is left as a TODO. gorelease actually tests for modules with different paths, but its test had a mistaken assumption (see the README.txt in this CL) so we had to change it. Change-Id: Id06eff0b43292088a016d8556e0c7c9c86616289 Reviewed-on: https://go-review.googlesource.com/c/exp/+/513635 Run-TryBot: Jonathan Amsterdam <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Robert Findley <[email protected]>
- Loading branch information
Showing
5 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package p | ||
|
||
// This test demonstrates correct handling of symbols | ||
// in packages other than two being compared. | ||
// See the lines in establishCorrespondence after | ||
// if newn, ok := new.(*types.Named); ok | ||
|
||
// both | ||
|
||
// gofmt insists on grouping imports, so old and new | ||
// must both have both imports. | ||
import ( | ||
"io" | ||
"text/tabwriter" | ||
) | ||
|
||
// old | ||
var V io.Writer | ||
var _ tabwriter.Writer | ||
|
||
// new | ||
// i V: changed from io.Writer to text/tabwriter.Writer | ||
var V tabwriter.Writer | ||
var _ io.Writer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ version=v1.0.0 | |
release=v1.0.1 | ||
base=example.com/internalcompat/[email protected] | ||
-- want -- | ||
# example.com/internalcompat/a/p | ||
## incompatible changes | ||
V: changed from example.com/internalcompat/a/q.Q to example.com/internalcompat/b/q.Q |