]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: avoid confusing error message "have m(T), want m(T)"
authorRobert Griesemer <gri@golang.org>
Tue, 12 Dec 2023 23:40:16 +0000 (15:40 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 13 Dec 2023 14:32:38 +0000 (14:32 +0000)
commit58c28ba286dd0e98fe4cca80f5d64bbcb824a685
tree736fe001a9241e3a352591f114e2a68e24a83d77
parent7cac742f1769f92313eac2188088c36d4aae1b74
go/types, types2: avoid confusing error message "have m(T), want m(T)"

This is a partial fix for situations where a method lookup leads to
an error due to non-matching signatures, but where the signatures
print exactly the same. This can happen if both signatures contain
type parameters (after instantiation) and the type parameters have
the same name (such as "T").

For now, rather than printing a confusing error message in this
case, leave away the confusing part of the error message (at the
cost of providing slightly less information).

In the long run, we need to find a better solution for this problem;
but this seems better than what we had before.

For #61685.

Change-Id: I259183f08b9db400ffc8e1cf447967c640a0f444
Reviewed-on: https://go-review.googlesource.com/c/go/+/549296
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/lookup.go
src/go/types/lookup.go
src/internal/types/testdata/fixedbugs/issue61685.go [new file with mode: 0644]