Skip to content

Commit 26fa282

Browse files
committed
resolve type aliases
1 parent e97417a commit 26fa282

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
@@ -1782,6 +1782,12 @@ bool TypeSystemSwiftTypeRef::IsPossibleDynamicType(opaque_compiler_type_t type,
17821782
if (!node)
17831783
return false;
17841784

1785+
if (node->getKind() == Node::Kind::TypeAlias) {
1786+
auto resolved = ResolveTypeAlias(m_swift_ast_context, dem, node);
1787+
if (resolved.first)
1788+
node = resolved.first;
1789+
}
1790+
17851791
switch (node->getKind()) {
17861792
case Node::Kind::Class:
17871793
case Node::Kind::BoundGenericClass:
@@ -1792,17 +1798,6 @@ bool TypeSystemSwiftTypeRef::IsPossibleDynamicType(opaque_compiler_type_t type,
17921798
case Node::Kind::ExistentialMetatype:
17931799
case Node::Kind::DynamicSelf:
17941800
return true;
1795-
case Node::Kind::TypeAlias: {
1796-
if (node->getNumChildren() == 2) {
1797-
auto *module = node->getFirstChild();
1798-
auto *identifier = node->getLastChild();
1799-
return module->getKind() == Node::Kind::Module &&
1800-
identifier->getKind() == Node::Kind::Identifier &&
1801-
module->getText() == "Swift" &&
1802-
identifier->getText() == "AnyObject";
1803-
}
1804-
break;
1805-
}
18061801
case Node::Kind::BuiltinTypeName: {
18071802
if (!node->hasText())
18081803
return false;

0 commit comments

Comments
 (0)