]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: support type parameters in NewMethodSet
authorRob Findley <rfindley@google.com>
Mon, 19 Apr 2021 21:18:54 +0000 (17:18 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 20 Apr 2021 15:13:47 +0000 (15:13 +0000)
commit4ce49b4a158b3ace253a3302f6092862c8109a94
treea40a39d0080a9e28cfd727250b6e69df0b6f86f3
parentaf8a176e911a013ab5054318224a90e5bab67efc
go/types: support type parameters in NewMethodSet

Add handling for TypeParams in NewMethodSet, to bring it in sync with
lookupFieldOrMethod. Also add a test, since we had none. I wanted this
fix to get gopls completion working with type params, but due to the
subtlety of lookupFieldOrMethod, I left a TODO to confirm that there are
no behavioral differences between the APIs.

Updates #45639

Change-Id: I16723e16d4d944ca4ecb4d87fc196815abb6fcff
Reviewed-on: https://go-review.googlesource.com/c/go/+/311455
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/api_test.go
src/go/types/lookup.go
src/go/types/methodset.go
src/go/types/methodset_test.go [new file with mode: 0644]