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