@@ -428,7 +428,7 @@ Type GenericSignatureImpl::getSuperclassBound(Type type) const {
428428// / required to conform.
429429GenericSignature::RequiredProtocols
430430GenericSignatureImpl::getRequiredProtocols (Type type) const {
431- if (! type->isTypeParameter ()) return { } ;
431+ assert ( type->isTypeParameter () && " Expected a type parameter " ) ;
432432
433433 auto &builder = *getGenericSignatureBuilder ();
434434 auto equivClass =
@@ -479,11 +479,11 @@ bool GenericSignatureImpl::isConcreteType(Type type) const {
479479 return bool (getConcreteType (type));
480480}
481481
482- // / Return the concrete type that the given dependent type is constrained to,
482+ // / Return the concrete type that the given type parameter is constrained to,
483483// / or the null Type if it is not the subject of a concrete same-type
484484// / constraint.
485485Type GenericSignatureImpl::getConcreteType (Type type) const {
486- if (! type->isTypeParameter ()) return Type ( );
486+ assert ( type->isTypeParameter () && " Expected a type parameter " );
487487
488488 auto &builder = *getGenericSignatureBuilder ();
489489 auto equivClass =
@@ -496,7 +496,8 @@ Type GenericSignatureImpl::getConcreteType(Type type) const {
496496}
497497
498498LayoutConstraint GenericSignatureImpl::getLayoutConstraint (Type type) const {
499- if (!type->isTypeParameter ()) return LayoutConstraint ();
499+ assert (type->isTypeParameter () &&
500+ " Only type parameters can have layout constraints" );
500501
501502 auto &builder = *getGenericSignatureBuilder ();
502503 auto equivClass =
0 commit comments