]> Cypherpunks repositories - gostls13.git/commit
go/types: don't associate methods with alias type names
authorRobert Griesemer <gri@golang.org>
Thu, 14 Dec 2017 05:37:13 +0000 (21:37 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 12 Feb 2018 21:40:14 +0000 (21:40 +0000)
commitcf12fef5c6fabaa2c5089ba31b4354514c67d8e5
treeaf35e0f383c32795d9cd14b46167686039fa9bef
parent973393c2930237649760be16e7132a42f4c93141
go/types: don't associate methods with alias type names

R=go1.11

The existing code associated methods with receiver base type
names before knowing if a type name denoted a locally defined
type. Sometimes, methods would be incorrectly associated with
alias type names and consequently were lost down the road.

This change first collects all methods with non-blank names
and in a follow-up pass resolves receiver base type names to
valid non-alias type names with which the methods are then
associated.

Fixes #23042.

Change-Id: I7699e577b70aadef6a2997e882beb0644da89fa3
Reviewed-on: https://go-review.googlesource.com/83996
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/check.go
src/go/types/decl.go
src/go/types/resolver.go
src/go/types/testdata/decls4.src