• Matthew Dempsky's avatar
    cmd/compile: cleanup method symbol creation · 638f112d
    Matthew Dempsky authored
    There were multiple ad hoc ways to create method symbols, with subtle
    and confusing differences between them. This CL unifies them into a
    single well-documented encoding and implementation.
    
    This introduces some inconsequential changes to symbol format for the
    sake of simplicity and consistency. Two notable changes:
    
    1) Symbol construction is now insensitive to the package currently
    being compiled. Previously, non-exported methods on anonymous types
    received different method symbols depending on whether the method was
    local or imported.
    
    2) Symbols for method values parenthesized non-pointer receiver types
    and non-exported method names, and also always package-qualified
    non-exported method names. Now they use the same rules as normal
    method symbols.
    
    The methodSym function is also now stricter about rejecting
    non-sensical method/receiver combinations. Notably, this means that
    typecheckfunc needs to call addmethod to validate the method before
    calling declare, which also means we no longer emit errors about
    redeclaring bogus methods.
    
    Change-Id: I9501c7a53dd70ef60e5c74603974e5ecc06e2003
    Reviewed-on: https://go-review.googlesource.com/104876Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    638f112d
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...