diff --git a/lib/AST/GenericSignature.cpp b/lib/AST/GenericSignature.cpp index 46b8dcac3fd02..a0e55c335a459 100644 --- a/lib/AST/GenericSignature.cpp +++ b/lib/AST/GenericSignature.cpp @@ -379,7 +379,8 @@ GenericSignatureImpl::lookupConformance(CanType type, } bool GenericSignatureImpl::requiresClass(Type type) { - if (!type->isTypeParameter()) return false; + assert(type->isTypeParameter() && + "Only type parameters can have superclass requirements"); auto &builder = *getGenericSignatureBuilder(); auto equivClass = diff --git a/lib/SIL/IR/AbstractionPattern.cpp b/lib/SIL/IR/AbstractionPattern.cpp index 1b4738e4a4648..9f8592da05d99 100644 --- a/lib/SIL/IR/AbstractionPattern.cpp +++ b/lib/SIL/IR/AbstractionPattern.cpp @@ -222,8 +222,7 @@ bool AbstractionPattern::requiresClass() const { auto type = getType(); if (auto archetype = dyn_cast(type)) return archetype->requiresClass(); - if (isa(type) || - isa(type)) { + if (type->isTypeParameter()) { if (getKind() == Kind::ClangType) { // ObjC generics are always class constrained. return true;