]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: better error reporting for Checker.implements
authorRobert Griesemer <gri@golang.org>
Thu, 27 Jan 2022 18:28:46 +0000 (10:28 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 28 Jan 2022 22:21:36 +0000 (22:21 +0000)
commit2e30c4b4bb7c4426ebc27e8af6d0570dbd97054b
treecc7f6c6052dbbd87457fd10eb481a1f05689dc93
parent654d5f4b5dfc30167bbffd0d7aeba3c1e29277c8
go/types, types2: better error reporting for Checker.implements

This CL copies (and adjusts as needed) the logic for error reporting
from operand.assignableTo to Checker.implements in the case of a missing
method failure and assignment to an interface pointer.

Preparation for using Checker.implements in operand.assignableTo
rather than implementing the same logic twice.

This also leads to better errors from Checker.implements as it's
using the same logic we already use elsewhere.

For #50646.

Change-Id: I199a1e02cf328b222ae52c10131db871539863bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/381434
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/instantiate.go
src/cmd/compile/internal/types2/testdata/check/issues.go2
src/go/types/instantiate.go
src/go/types/testdata/check/issues.go2