Skip to content

Commit 7bf390a

Browse files
author
Davide Italiano
committed
[TypeReconstruction] Apply substistution when reconstructing typealiases.
Thanks to Slava for pointing this fix out.
1 parent 7ec8133 commit 7bf390a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/IDE/TypeReconstruction.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,11 +792,11 @@ static void VisitNodeGenericTypealias(ASTContext *ast,
792792
Type parentType;
793793
if (auto nominal = genericTypeAlias->getDeclContext()
794794
->getAsNominalTypeOrNominalTypeExtensionContext()) {
795-
parentType = nominal->getDeclaredInterfaceType();
795+
parentType = nominal->getDeclaredInterfaceType().subst(subMap);
796796
}
797-
NameAliasType *NAT =
798-
NameAliasType::get(genericTypeAlias, parentType, subMap,
799-
genericTypeAlias->getUnderlyingTypeLoc().getType());
797+
NameAliasType *NAT = NameAliasType::get(
798+
genericTypeAlias, parentType, subMap,
799+
genericTypeAlias->getDeclaredInterfaceType().subst(subMap));
800800
result._types.push_back(NAT);
801801
result._decls.push_back(genericTypeAlias);
802802
}

0 commit comments

Comments
 (0)