From: Robert Griesemer Date: Tue, 14 Apr 2020 04:57:41 +0000 (-0700) Subject: go/types: use same local variable consistently (minor cleanup) X-Git-Tag: go1.15beta1~561 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f3424ceff2fa48615ed98580f337ab044925c940;p=gostls13.git 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 --- 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()