]> Cypherpunks repositories - gostls13.git/commit
go/types: copy embedded methods unchanged when completing interfaces
authorRobert Griesemer <gri@golang.org>
Mon, 22 Oct 2018 17:54:38 +0000 (10:54 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 22 Oct 2018 18:16:38 +0000 (18:16 +0000)
commite9b39417e4448d6001b2707d9cf42bba4673e9ab
treed452f76f2354e042aa5ad3587a458985e81df46b
parentffbf479ae1cc8d85022fd74b6ad35b419279b162
go/types: copy embedded methods unchanged when completing interfaces

The existing code adjusted the receivers of embedded interface methods
to match the embedding interface type. That required cloning (shallow
copying) the embedded methods and destroyed their object identity in
the process. Don't do this anymore. The consequence to clients is that
they might see different methods of an interface having different
receiver types; they are always the type of the interface that explicitly
declared the method (which is what one usually would want, anyway).

Fixes #28282.

Change-Id: I2e6f1497f46affdf7510547a64601de3787367db
Reviewed-on: https://go-review.googlesource.com/c/143757
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/issues_test.go
src/go/types/stdlib_test.go
src/go/types/type.go