]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: use same method lookup code in both type checkers
authorRobert Griesemer <gri@golang.org>
Wed, 2 Feb 2022 21:18:56 +0000 (13:18 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 4 Feb 2022 23:42:35 +0000 (23:42 +0000)
commitd5bd3f9a6c3833d0c12ec45e1c73f8adf32ee2dd
treec8699aca5d1f31b90ae3cdd073c015473c9a9466
parent63e833154c230e9f46b41f913b12d3c72912cabc
go/types, types2: use same method lookup code in both type checkers

types2 has some code to handle case-folding when doing method lookups
which was missing in go/types. This change is a first step to match
the implementations. Specifically:

In types2:
- remove the lookupMethodFold names in favor of just lookupMethod,
  but with the foldCase flag (e.g., instead if lookupMethodFold,
  we just use lookupMethod)
- rename checkFold to foldCase everywhere
- add foldCase parameter where it was missing
- moved foldCase paremeter to the end in lookupFieldOrMethod
- no functionality changes

In go/types:
- match function signatures with types2 use
- always provide false as argument for foldCase for now
- no functionality changes

Preparation for fixing some of the outstanding error reporting issues.

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