]> Cypherpunks repositories - gostls13.git/commitdiff
go/internal/gcimporter: parse materialized aliases
authorTim King <taking@google.com>
Thu, 22 Aug 2024 20:38:25 +0000 (13:38 -0700)
committerTim King <taking@google.com>
Mon, 26 Aug 2024 21:03:19 +0000 (21:03 +0000)
Parse materialized aliases in indexed format.

This was in https://go.dev/cl/574717 in x/tools.

Updates #68778

Change-Id: I2f0871aeb5a2e74c803176001f178757766a4a0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/607498
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/go/internal/gcimporter/iimport.go

index b36210c8179af53470b6381ccac666402da3190a..b2c2ad476b25c9386f3f2b5fe1b159f8cc530d7f 100644 (file)
@@ -77,6 +77,7 @@ const (
        typeParamType
        instanceType
        unionType
+       aliasType
 )
 
 // iImportData imports a package from the serialized package data
@@ -619,7 +620,7 @@ func (r *importReader) doType(base *types.Named) types.Type {
                errorf("unexpected kind tag in %q: %v", r.p.ipath, k)
                return nil
 
-       case definedType:
+       case aliasType, definedType:
                pkg, name := r.qualifiedIdent()
                r.p.doDecl(pkg, name)
                return pkg.Scope().Lookup(name).(*types.TypeName).Type()