AST: Update TypeBase::mayHaveSuperclass() for subclass existentials

This commit is contained in:
Slava Pestov
2017-04-10 00:25:58 -07:00
parent 473faf1eed
commit b1d22ffad2

View File

@@ -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>();
}