From f3424ceff2fa48615ed98580f337ab044925c940 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 13 Apr 2020 21:57:41 -0700 Subject: [PATCH] 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 Reviewed-by: Ian Lance Taylor --- src/go/types/operand.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/types/operand.go b/src/go/types/operand.go index 1259f44300..d0e7531d4f 100644 --- a/src/go/types/operand.go +++ b/src/go/types/operand.go @@ -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() -- 2.50.0