mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Update TypeBase::mayHaveSuperclass() for subclass existentials
This commit is contained in:
@@ -4556,9 +4556,14 @@ inline bool TypeBase::mayHaveSuperclass() {
|
|||||||
if (getClassOrBoundGenericClass())
|
if (getClassOrBoundGenericClass())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// FIXME: requiresClass() is not the same as having an explicit superclass;
|
||||||
|
// is this wrong?
|
||||||
if (auto archetype = getAs<ArchetypeType>())
|
if (auto archetype = getAs<ArchetypeType>())
|
||||||
return (bool)archetype->requiresClass();
|
return (bool)archetype->requiresClass();
|
||||||
|
|
||||||
|
if (isExistentialType())
|
||||||
|
return (bool)getSuperclass(nullptr);
|
||||||
|
|
||||||
return is<DynamicSelfType>();
|
return is<DynamicSelfType>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user