@@ -410,8 +410,9 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types2.Package, string) {
410
410
411
411
case pkgbits .ObjAlias :
412
412
pos := r .pos ()
413
+ var tparams []* types2.TypeParam // TODO(#68778): Read tparams for unified IR.
413
414
typ := r .typ ()
414
- return newAliasTypeName (pr .enableAlias , pos , objPkg , objName , typ )
415
+ return newAliasTypeName (pr .enableAlias , pos , objPkg , objName , typ , tparams )
415
416
416
417
case pkgbits .ObjConst :
417
418
pos := r .pos ()
@@ -537,13 +538,15 @@ func (r *reader) ident(marker pkgbits.SyncMarker) (*types2.Package, string) {
537
538
}
538
539
539
540
// newAliasTypeName returns a new TypeName, with a materialized *types2.Alias if supported.
540
- func newAliasTypeName (aliases bool , pos syntax.Pos , pkg * types2.Package , name string , rhs types2.Type ) * types2.TypeName {
541
+ func newAliasTypeName (aliases bool , pos syntax.Pos , pkg * types2.Package , name string , rhs types2.Type , tparams [] * types2. TypeParam ) * types2.TypeName {
541
542
// Copied from x/tools/internal/aliases.NewAlias via
542
543
// GOROOT/src/go/internal/gcimporter/ureader.go.
543
544
if aliases {
544
545
tname := types2 .NewTypeName (pos , pkg , name , nil )
545
- _ = types2 .NewAlias (tname , rhs ) // form TypeName -> Alias cycle
546
+ a := types2 .NewAlias (tname , rhs ) // form TypeName -> Alias cycle
547
+ a .SetTypeParams (tparams )
546
548
return tname
547
549
}
550
+ assert (len (tparams ) == 0 )
548
551
return types2 .NewTypeName (pos , pkg , name , rhs )
549
552
}
0 commit comments