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) {
411
411
412
412
// / Determine the superclass bound on the given dependent type.
413
413
Type GenericSignatureImpl::getSuperclassBound (Type type) {
414
- if (!type->isTypeParameter ()) return nullptr ;
414
+ assert (type->isTypeParameter () &&
415
+ " Only type parameters can have superclass requirements" );
415
416
416
417
auto &builder = *getGenericSignatureBuilder ();
417
418
auto equivClass =
@@ -457,8 +458,7 @@ GenericSignatureImpl::getConformsTo(Type type) {
457
458
}
458
459
459
460
bool 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" );
462
462
463
463
auto &builder = *getGenericSignatureBuilder ();
464
464
auto equivClass =
@@ -562,7 +562,7 @@ bool GenericSignatureImpl::isRequirementSatisfied(Requirement requirement) {
562
562
// requirement, but it could also be in terms of concrete types if it has
563
563
// been substituted/otherwise 'resolved', so we need to handle both.
564
564
auto baseType = canFirstType;
565
- if (canFirstType ->isTypeParameter ()) {
565
+ if (baseType ->isTypeParameter ()) {
566
566
auto directSuperclass = getSuperclassBound (baseType);
567
567
if (!directSuperclass)
568
568
return false ;
You can’t perform that action at this time.
0 commit comments