]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: use same local variable consistently (minor cleanup)
authorRobert Griesemer <gri@golang.org>
Tue, 14 Apr 2020 04:57:41 +0000 (21:57 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 14 Apr 2020 05:11:01 +0000 (05:11 +0000)
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>
src/go/types/operand.go

index 1259f443000b3e9fcb2bac78ccb936839739d6f8..d0e7531d4f316d0a04b4b59727914af3a1a2adac 100644 (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()