]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/importer, gcimporter: use *TypeParam as tparamIndex map value
authorRobert Griesemer <gri@golang.org>
Wed, 19 Jan 2022 23:48:17 +0000 (15:48 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 20 Jan 2022 01:03:13 +0000 (01:03 +0000)
This is a map from identifiers to type parameters, use *TypeParam
as map value instead of Type.

Change-Id: Ib006393418c6352bcffc1c6796c5e002c33d9f4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/379634
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/importer/iimport.go
src/go/internal/gcimporter/iimport.go

index 7c51d3b16fc4b669bd4757e1257d3fef713716bb..691e9b697656bcf4d2df5ad59100df5855aec4c1 100644 (file)
@@ -126,7 +126,7 @@ func ImportData(imports map[string]*types2.Package, data, path string) (pkg *typ
                typCache: make(map[uint64]types2.Type),
                // Separate map for typeparams, keyed by their package and unique
                // name (name with subscript).
-               tparamIndex: make(map[ident]types2.Type),
+               tparamIndex: make(map[ident]*types2.TypeParam),
        }
 
        for i, pt := range predeclared {
@@ -202,7 +202,7 @@ type iimporter struct {
        declData    string
        pkgIndex    map[*types2.Package]map[string]uint64
        typCache    map[uint64]types2.Type
-       tparamIndex map[ident]types2.Type
+       tparamIndex map[ident]*types2.TypeParam
 
        interfaceList []*types2.Interface
 }
index c5b89aa042a746ce154fc91465e5b2b590a8c69f..ee8dd0ee7c38805d4f2ddc53eddd82587ae24989 100644 (file)
@@ -127,7 +127,7 @@ func iImportData(fset *token.FileSet, imports map[string]*types.Package, dataRea
                typCache: make(map[uint64]types.Type),
                // Separate map for typeparams, keyed by their package and unique
                // name (name with subscript).
-               tparamIndex: make(map[ident]types.Type),
+               tparamIndex: make(map[ident]*types.TypeParam),
 
                fake: fakeFileSet{
                        fset:  fset,
@@ -207,7 +207,7 @@ type iimporter struct {
        declData    []byte
        pkgIndex    map[*types.Package]map[string]uint64
        typCache    map[uint64]types.Type
-       tparamIndex map[ident]types.Type
+       tparamIndex map[ident]*types.TypeParam
 
        fake          fakeFileSet
        interfaceList []*types.Interface