go/types: use correct package when creating a new instantiated type

Fix provided by iant@.

Change-Id: Iec89f007cfe9b9b50351122a03550e64238f9c44
This commit is contained in:
Robert Griesemer 2020-02-19 12:51:53 -08:00
parent 3d8c442870
commit 6c083a7972
1 changed files with 1 additions and 1 deletions

View File

@ -324,7 +324,7 @@ func (subst *subster) typ(typ Type) Type {
}
// create a new named type and populate caches to avoid endless recursion
tname := NewTypeName(subst.pos, subst.check.pkg, name, nil)
tname := NewTypeName(subst.pos, t.obj.pkg, name, nil)
subst.check.typMap[name] = tname
named := NewNamed(tname, nil, nil)
named.tparams = t.tparams // new type is still parameterized