tools/cmd
Alan Donovan c6ec5ea66d cmd/gorename: support renaming of methods with consequences for other types, iff initiated at an abstract method.
Previously, gorename rejected all method renamings if it would
change the assignability relation.

Now, so long as the renaming was initiated at an abstract
method, the renaming proceeds, changing concrete methods (and
possibly other abstract methods) as needed.  The user
intention is clear.

The intention of a renaming initiated at a concrete method is
less clear, so we still reject it if it would change the
assignability relation.  The diagnostic advises the user to
rename the abstract method if that was the intention.

Additional safety checks are required: for each
satisfy.Constraint that couples a concrete type C and an
interface type I, we must treat it just like a set of implicit
selections C.f, one per abstract method f of I, and ensure the
selections' meanings are unchanged.

The satisfy package no longer canonicalizes types, since this
substitutes one interface for another (equivalent) one, which
is sound, but makes the type names random and the error
messages confusing.

Also, fixed a bug in 'satisfy' relating to map keys.

+ Lots more tests.

LGTM=sameer
R=sameer
CC=golang-codereviews
https://golang.org/cl/173430043
2014-12-04 09:37:50 -05:00
..
benchcmp benchcmp: Fix invocation instructions. 2014-07-22 17:50:39 +10:00
callgraph cmd/callgraph: add -algo=static and -algo=cha options. 2014-11-21 11:07:56 -05:00
cover go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
digraph x/tools/*: print program name, not "Error", when reporting command error messages. 2014-11-17 12:58:28 -05:00
eg x/tools/*: print program name, not "Error", when reporting command error messages. 2014-11-17 12:58:28 -05:00
godex go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
godoc x/tools/cmd/godoc: add golang.org/x/oauth2 import path 2014-11-26 15:31:30 +11:00
goimports go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
gorename cmd/gorename: support renaming of methods with consequences for other types, iff initiated at an abstract method. 2014-12-04 09:37:50 -05:00
gotype go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
html2article go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
oracle cmd/oracle: minor fixes. 2014-11-17 13:50:23 -05:00
present go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
ssadump x/tools/*: print program name, not "Error", when reporting command error messages. 2014-11-17 12:58:28 -05:00
stringer tools/cmd/vet: check that cgo is enabled before testing it 2014-12-02 08:15:26 +09:00
vet go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00