]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: use existing case-insensitive lookup (remove TODO)
authorRobert Griesemer <gri@golang.org>
Wed, 24 Jan 2024 20:42:11 +0000 (12:42 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 26 Jan 2024 14:04:26 +0000 (14:04 +0000)
commit8e02e7b26af46a1d113057ac49ad440a39a45d58
treebf9a31128347256bcfa152b452b9c29cf5220035
parentd278d5bbdddd0e976c272d1dd3ecc41eeb37daf9
go/types, types2: use existing case-insensitive lookup (remove TODO)

Rather than implementing a new, less complete mechanism to check
if a selector exists with different capitalization, use the
existing mechanism in lookupFieldOrMethodImpl by making it
available for internal use.

Pass foldCase parameter all the way trough to Object.sameId and
thus make it consistently available where Object.sameId is used.

From sameId, factor out samePkg functionality into stand-alone
predicate.

Do better case distinction when reporting an error for an undefined
selector expression.

Cleanup.

Change-Id: I7be3cecb4976a4dce3264c7e0c49a320c87101e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/558315
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
19 files changed:
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/object.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/scope.go
src/cmd/compile/internal/types2/unify.go
src/go/types/builtins.go
src/go/types/call.go
src/go/types/expr.go
src/go/types/lookup.go
src/go/types/object.go
src/go/types/predicates.go
src/go/types/scope.go
src/go/types/unify.go
src/internal/types/testdata/check/issues0.go
src/internal/types/testdata/check/lookup.go [new file with mode: 0644]
test/fixedbugs/issue22794.go