]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: add the Interface.IsMethodSet method
authorRobert Findley <rfindley@google.com>
Mon, 27 Sep 2021 23:49:38 +0000 (19:49 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 28 Sep 2021 15:20:55 +0000 (15:20 +0000)
commit02d56a1584f968b86b669b3b943dc2ffad30e087
treed826cbaeb4fb4f3b855a6541196a6d7bf2b85c0c
parent5511f14a735736e88c5fc832975f9b27244c56e1
go/types: add the Interface.IsMethodSet method

As pointed out in #47916, the IsConstraint method becomes ambiguously
named if ever we allow interfaces with structural restrictions outside
of constraint position.

Add instead an IsMethodSet method, which has the opposite sense and
avoids this ambiguity. In a subsequent CL the IsConstraint method will
be removed, once x/tools has been updated to use the IsMethodSet API.

Updates #47916

Change-Id: I82ad16b111464b0cd2f354b8ecdd4b3f14796cd9
Reviewed-on: https://go-review.googlesource.com/c/go/+/352616
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/interface.go