1
0
mirror of https://github.com/golang/go synced 2024-11-23 08:40:08 -07:00

go/types: use same local variable consistently (minor cleanup)

Currently this CL has no effect because V == x.typ in the affected
code. But if we should ever manipulate V (e.g., to support some form
of lazy evaluation of the type), not using V consistently would
lead to a subtle bug.

Change-Id: I465e72d18bbd2b6cd8fcbd746e0d28d14f758c03
Reviewed-on: https://go-review.googlesource.com/c/go/+/228105
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Robert Griesemer 2020-04-13 21:57:41 -07:00
parent 201cb046b7
commit f3424ceff2

View File

@ -252,7 +252,7 @@ func (x *operand) assignableTo(check *Checker, T Type, reason *string) bool {
// T is an interface type and x implements T
if Ti, ok := Tu.(*Interface); ok {
if m, wrongType := check.missingMethod(x.typ, Ti, true); m != nil /* Implements(x.typ, Ti) */ {
if m, wrongType := check.missingMethod(V, Ti, true); m != nil /* Implements(V, Ti) */ {
if reason != nil {
if wrongType {
*reason = "wrong type for method " + m.Name()