File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,8 @@ bool GenericSignatureImpl::requiresClass(Type type) {
411411
412412// / Determine the superclass bound on the given dependent type.
413413Type GenericSignatureImpl::getSuperclassBound (Type type) {
414- if (!type->isTypeParameter ()) return nullptr ;
414+ assert (type->isTypeParameter () &&
415+ " Only type parameters can have superclass requirements" );
415416
416417 auto &builder = *getGenericSignatureBuilder ();
417418 auto equivClass =
@@ -457,8 +458,7 @@ GenericSignatureImpl::getConformsTo(Type type) {
457458}
458459
459460bool GenericSignatureImpl::conformsToProtocol (Type type, ProtocolDecl *proto) {
460- // FIXME: Deal with concrete conformances here?
461- if (!type->isTypeParameter ()) return false ;
461+ assert (type->isTypeParameter () && " Expected a type parameter" );
462462
463463 auto &builder = *getGenericSignatureBuilder ();
464464 auto equivClass =
@@ -562,7 +562,7 @@ bool GenericSignatureImpl::isRequirementSatisfied(Requirement requirement) {
562562 // requirement, but it could also be in terms of concrete types if it has
563563 // been substituted/otherwise 'resolved', so we need to handle both.
564564 auto baseType = canFirstType;
565- if (canFirstType ->isTypeParameter ()) {
565+ if (baseType ->isTypeParameter ()) {
566566 auto directSuperclass = getSuperclassBound (baseType);
567567 if (!directSuperclass)
568568 return false ;
You can’t perform that action at this time.
0 commit comments