]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: remove superflous type parameter length checks
authorRobert Griesemer <gri@golang.org>
Wed, 2 Feb 2022 23:04:58 +0000 (15:04 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 4 Feb 2022 23:42:38 +0000 (23:42 +0000)
commit727790a2fda02e75844ce91320c05fd2bf1f431d
tree04e398fb40650c4ef8b411892ef395d460afde12
parentd5bd3f9a6c3833d0c12ec45e1c73f8adf32ee2dd
go/types, types2: remove superflous type parameter length checks

There is no need to check for length equality of type parameter
lists in Checker.missingMethod: the Identical predicate does
this check. Furthermore, we don't have methods with their own
type parameters. Remove the unnecessary (duplicate) code.

Also, update doc string on missingMethod and rename the 2nd
result parameter for clarity, and clarify internal comments.

For go/types, include the same case-folding code as for types2
but leave it disabled or now. Adjust any other differences in
the missingMethod implementation.

With this change, the types2 and go/types code of missingMethod
is identical again except for the disabled case-folding lookup.

No functionality changes.

Preparation for fixing some of the outstanding error reporting issues.

Change-Id: I4778d006c17f4e084ecc2cac7386c68e86aa49eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/382614
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/lookup.go
src/go/types/lookup.go