aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2024-01-24 12:42:11 -0800
committerGopher Robot <gobot@golang.org>2024-01-26 14:04:26 +0000
commit8e02e7b26af46a1d113057ac49ad440a39a45d58 (patch)
treebf9a31128347256bcfa152b452b9c29cf5220035 /test
parentd278d5bbdddd0e976c272d1dd3ecc41eeb37daf9 (diff)
downloadgo-8e02e7b26af46a1d113057ac49ad440a39a45d58.tar.gz
go-8e02e7b26af46a1d113057ac49ad440a39a45d58.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue22794.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/fixedbugs/issue22794.go b/test/fixedbugs/issue22794.go
index 636af26e84..933c83dc5b 100644
--- a/test/fixedbugs/issue22794.go
+++ b/test/fixedbugs/issue22794.go
@@ -13,9 +13,9 @@ type it struct {
func main() {
i1 := it{Floats: true}
- if i1.floats { // ERROR "(type it .* field or method floats, but does have Floats)|undefined field or method"
+ if i1.floats { // ERROR "(type it .* field or method floats, but does have field Floats)|undefined field or method"
}
- i2 := &it{floats: false} // ERROR "(but does have Floats)|unknown field|declared and not used"
- _ = &it{InneR: "foo"} // ERROR "(but does have inner)|unknown field"
+ i2 := &it{floats: false} // ERROR "(but does have field Floats)|unknown field|declared and not used"
+ _ = &it{InneR: "foo"} // ERROR "(but does have field inner)|unknown field"
_ = i2
}