]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/types2: remove unneccesary tests in implements and lookup
authorRobert Griesemer <gri@golang.org>
Mon, 15 Nov 2021 04:45:40 +0000 (20:45 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 15 Nov 2021 21:22:18 +0000 (21:22 +0000)
commitc8d7c5fe0511569f19d4ebed29f11d96f50b3e07
tree592dca15812ee1c019c3e8bf5b7949b1ed801efc
parente08aae2ee443ba8bb16b8ce9c5d3d8d4d3cfa82b
cmd/compile/internal/types2: remove unneccesary tests in implements and lookup

Because the underlying type of a type parameter is an interface,
the questions whether *P for a type parameter P has methods or
not is settled: P is also an interface pointers to interfaces
don't have methods.

This allows us to eliminate the now unneccesary test in "implements"
and also allows us to remove a special case for type parameters in
"lookupFieldOrMethod".

Change-Id: I8b218f81584a8e42e75884089a44293365b700df
Reviewed-on: https://go-review.googlesource.com/c/go/+/363838
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/instantiate.go
src/cmd/compile/internal/types2/lookup.go