]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add missing method info for method with correct name except for case
authorDan Scales <danscales@google.com>
Thu, 11 Nov 2021 18:28:17 +0000 (10:28 -0800)
committerDan Scales <danscales@google.com>
Fri, 12 Nov 2021 23:07:14 +0000 (23:07 +0000)
commit429d1e01557f95bba29837f2190441696484fd41
tree2df54c6f1fe1c9aeeee78865bb9bdeda8f285b90
parentc8d6ee12d5eb1c64f2aff8a4d511f677a64e3aed
cmd/compile: add missing method info for method with correct name except for case

When being used by the compiler, augment the types2 missing method
message with extra info, if a method is missing, but a method with the
correct name except for case (i.e. equal via string.EqualFold()) is
present. In that case, print out the wanted method and the method that
is present (that has the wrong case).

In the 1.17 compiler, we don't do this case-folding check when assigning
an interface to an interface, so I didn't add that check, but we could
add that.

Fixes #48471

Change-Id: Ic54549c1f66297c9221d979d49c1daa719aa66cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/363437
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/types2/lookup.go
test/fixedbugs/issue48471.go