]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: rename rparamMap to recvTParamMap to match types2
authorRobert Griesemer <gri@golang.org>
Fri, 8 Oct 2021 16:52:37 +0000 (09:52 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 8 Oct 2021 17:32:31 +0000 (17:32 +0000)
See also CL 354693.

Change-Id: Id7579c5f7d486652a5b53b29663a6573a493121f
Reviewed-on: https://go-review.googlesource.com/c/go/+/354694
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/go/types/check.go
src/go/types/signature.go
src/go/types/typexpr.go

index fa3bd94681e3615ef99bb78f853fc6896e4f2239..46a0000940e1d8fd68dbfbf1d671e0547925c50a 100644 (file)
@@ -103,10 +103,10 @@ type Checker struct {
        // information collected during type-checking of a set of package files
        // (initialized by Files, valid only for the duration of check.Files;
        // maps and lists are allocated on demand)
-       files        []*ast.File               // package files
-       imports      []*PkgName                // list of imported packages
-       dotImportMap map[dotImportKey]*PkgName // maps dot-imported objects to the package they were dot-imported through
-       rparamMap    map[*ast.Ident]*TypeParam // maps blank receiver type params to their type
+       files         []*ast.File               // package files
+       imports       []*PkgName                // list of imported packages
+       dotImportMap  map[dotImportKey]*PkgName // maps dot-imported objects to the package they were dot-imported through
+       recvTParamMap map[*ast.Ident]*TypeParam // maps blank receiver type parameters to their type
 
        firstErr error                 // first error encountered
        methods  map[*TypeName][]*Func // maps package scope type names to associated non-blank (non-interface) methods
@@ -284,7 +284,7 @@ func (check *Checker) checkFiles(files []*ast.File) (err error) {
        check.dotImportMap = nil
        check.pkgPathMap = nil
        check.seenPkgMap = nil
-       check.rparamMap = nil
+       check.recvTParamMap = nil
 
        // TODO(rFindley) There's more memory we should release at this point.
 
index ae7818afdf48e550b79bf7aa75da9594ec594f42..c83bf090320ca1ed735d70a5e1525a73e5283bbe 100644 (file)
@@ -117,16 +117,16 @@ func (check *Checker) funcType(sig *Signature, recvPar *ast.FieldList, ftyp *ast
                        // receiver type expression would fail in Checker.collectParams below,
                        // when Checker.ident cannot resolve the _ to a type.
                        //
-                       // Checker.rparamMap maps these blank identifiers to their type parameter
+                       // Checker.recvTParamMap maps these blank identifiers to their type parameter
                        // types, so that they may be resolved in Checker.ident when they fail
                        // lookup in the scope.
                        for i, p := range rparams {
                                if p.Name == "_" {
                                        tpar := sig.rparams.At(i)
-                                       if check.rparamMap == nil {
-                                               check.rparamMap = make(map[*ast.Ident]*TypeParam)
+                                       if check.recvTParamMap == nil {
+                                               check.recvTParamMap = make(map[*ast.Ident]*TypeParam)
                                        }
-                                       check.rparamMap[p] = tpar
+                                       check.recvTParamMap[p] = tpar
                                }
                        }
                        // determine receiver type to get its type parameters
index f581effc19be77dddc808bd1021cf1c1081b94a8..71623c336ec830d53ae61a79964e2315498fd49f 100644 (file)
@@ -32,8 +32,8 @@ func (check *Checker) ident(x *operand, e *ast.Ident, def *Named, wantType bool)
                if e.Name == "_" {
                        // Blank identifiers are never declared, but the current identifier may
                        // be a placeholder for a receiver type parameter. In this case we can
-                       // resolve its type and object from Checker.rparamMap.
-                       if tpar := check.rparamMap[e]; tpar != nil {
+                       // resolve its type and object from Checker.recvTParamMap.
+                       if tpar := check.recvTParamMap[e]; tpar != nil {
                                x.mode = typexpr
                                x.typ = tpar
                        } else {