]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: tweak missingMethodReason logic to improve message
authorDan Scales <danscales@google.com>
Wed, 26 Jan 2022 18:09:39 +0000 (10:09 -0800)
committerDan Scales <danscales@google.com>
Tue, 1 Feb 2022 16:52:46 +0000 (16:52 +0000)
commit902dc38212dfdc21911fc32035704ec50a7b9994
treefb4f194ac64bd9ccc92580c6ff9bd918d17bb4a4
parent93fe469de5388b71af2aa2c959dc485fa3d4bee3
go/types, types2: tweak missingMethodReason logic to improve message

This makes the error case pointed out in the issue like the current
message in Go 1.17 or -G=0 mode. The priority is to point out the
similar but wrong method name, rather than a difference in type.

Made changes to both cmd/compile/internal/types2 and go/types.
Added in a missing tab in an error message in go/types.

At the same time, removed the extra "at info" on the have lines (and
pointer receiver lines) of error messages, as requested in #50907.

Fixes #50816
Fixes #50907

Change-Id: I04f8151955bdb6192246cbcb59adc1c4b8a2c4e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/381774
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/testdata/check/issues.src
src/cmd/compile/internal/types2/testdata/fixedbugs/issue50816.go2 [new file with mode: 0644]
src/go/types/lookup.go
src/go/types/testdata/fixedbugs/issue50816.go2 [new file with mode: 0644]
test/fixedbugs/issue48471.go