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())
|
||||
return true;
|
||||
|
||||
// FIXME: requiresClass() is not the same as having an explicit superclass;
|
||||
// is this wrong?
|
||||
if (auto archetype = getAs<ArchetypeType>())
|
||||
return (bool)archetype->requiresClass();
|
||||
|
||||
if (isExistentialType())
|
||||
return (bool)getSuperclass(nullptr);
|
||||
|
||||
return is<DynamicSelfType>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user