]> Cypherpunks repositories - gostls13.git/commit
go/types: fix method set computation
authorRobert Griesemer <gri@golang.org>
Fri, 7 Feb 2020 23:26:19 +0000 (15:26 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 2 Mar 2020 22:18:30 +0000 (22:18 +0000)
commitca3dd1d36b5aa2dd810d31ec425a32902ae50ba9
treef48b67846fb9704d2e9f115d4f39cc20b126eadc
parent97a268624c9f2830133d2bdfae677f5d99ec82cb
go/types: fix method set computation

When computing method sets, any struct field that "shadows" a
method at a lower embedding level eliminates that method from
the method set. Treat any field at a given level as a "collision"
for any methods at lower embedding level.

Method sets are not directly used by go/types (except for self-
verification in debug mode); they are a functionality provided
by go/types. Thus, the method sets that go/types is using were
not affected by this bug.

Fixes #37081.

Change-Id: Ic1937e01891b3614a6f7965d4384aeb485f3fe3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/218617
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/example_test.go
src/go/types/methodset.go