• Robert Griesemer's avatar
    go/types: use correct receiver types for embedded interface methods · 76f57845
    Robert Griesemer authored
    Interface methods don't declare a receiver (it's implicit), but after
    type-checking the respective *types.Func objects are marked as methods
    by having a receiver. For interface methods, the receiver base type used
    to be the interface that declared the method in the first place, even if
    the method also appeared in other interfaces via embedding. A change in
    the computation of method sets for interfaces for Go1.10 changed that
    inadvertently, with the consequence that sometimes a method's receiver
    type ended up being an interface into which the method was embedded.
    The exact behavior also depended on file type-checking order, and because
    files are sometimes sorted by name, the behavior depended on file names.
    
    This didn't matter for type-checking (the typechecker doesn't need the
    receiver), but it matters for clients, and for printing of methods.
    
    This change fixes interface method receivers at the end of type-checking
    when we have all relevant information.
    
    Fixes #28005.
    
    Change-Id: I96c120fb0e517d7f8a14b8530f0273674569d5ea
    Reviewed-on: https://go-review.googlesource.com/c/141358Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
    76f57845
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...