File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1221,16 +1221,21 @@ bool ExtensionDecl::hasValidParent() const {
1221
1221
}
1222
1222
1223
1223
bool ExtensionDecl::isConstrainedExtension () const {
1224
- // Non-generic extension.
1225
- if (!getGenericSignature () )
1224
+ auto nominal = getExtendedNominal ();
1225
+ if (!nominal )
1226
1226
return false ;
1227
1227
1228
- auto nominal = getExtendedNominal ();
1229
- assert (nominal);
1228
+ auto typeSig = nominal->getGenericSignature ();
1229
+ if (!typeSig)
1230
+ return false ;
1231
+
1232
+ auto extSig = getGenericSignature ();
1233
+ if (!extSig)
1234
+ return false ;
1230
1235
1231
1236
// If the generic signature differs from that of the nominal type, it's a
1232
1237
// constrained extension.
1233
- return !getGenericSignature () ->isEqual (nominal-> getGenericSignature () );
1238
+ return !typeSig ->isEqual (extSig );
1234
1239
}
1235
1240
1236
1241
bool ExtensionDecl::isEquivalentToExtendedContext () const {
You can’t perform that action at this time.
0 commit comments