Skip to content

Commit 6f0563b

Browse files
committed
resolve type aliases
(cherry picked from commit 26fa282)
1 parent cd89c6b commit 6f0563b

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,12 @@ bool TypeSystemSwiftTypeRef::IsPossibleDynamicType(opaque_compiler_type_t type,
17801780
if (!node)
17811781
return false;
17821782

1783+
if (node->getKind() == Node::Kind::TypeAlias) {
1784+
auto resolved = ResolveTypeAlias(m_swift_ast_context, dem, node);
1785+
if (resolved.first)
1786+
node = resolved.first;
1787+
}
1788+
17831789
switch (node->getKind()) {
17841790
case Node::Kind::Class:
17851791
case Node::Kind::BoundGenericClass:
@@ -1790,17 +1796,6 @@ bool TypeSystemSwiftTypeRef::IsPossibleDynamicType(opaque_compiler_type_t type,
17901796
case Node::Kind::ExistentialMetatype:
17911797
case Node::Kind::DynamicSelf:
17921798
return true;
1793-
case Node::Kind::TypeAlias: {
1794-
if (node->getNumChildren() == 2) {
1795-
auto *module = node->getFirstChild();
1796-
auto *identifier = node->getLastChild();
1797-
return module->getKind() == Node::Kind::Module &&
1798-
identifier->getKind() == Node::Kind::Identifier &&
1799-
module->getText() == "Swift" &&
1800-
identifier->getText() == "AnyObject";
1801-
}
1802-
break;
1803-
}
18041799
case Node::Kind::BuiltinTypeName: {
18051800
if (!node->hasText())
18061801
return false;

0 commit comments

Comments
 (0)