@@ -651,30 +651,25 @@ static Type checkContextualRequirements(Type type,
651
651
return type;
652
652
}
653
653
654
- // We are interested in either a contextual where clause or
655
- // a constrained extension context.
656
- TypeSubstitutionMap subMap;
657
- GenericSignature genericSig;
658
654
SourceLoc noteLoc;
659
- if (decl->getTrailingWhereClause ()) {
660
- subMap = parentTy->getContextSubstitutions (decl->getDeclContext ());
661
- genericSig = decl->getGenericSignature ();
662
- noteLoc = decl->getLoc ();
663
- } else {
655
+ {
656
+ // We are interested in either a contextual where clause or
657
+ // a constrained extension context.
664
658
const auto ext = dyn_cast<ExtensionDecl>(decl->getDeclContext ());
665
- if (ext && ext-> isConstrainedExtension ()) {
666
- subMap = parentTy-> getContextSubstitutions (ext );
667
- genericSig = ext->getGenericSignature ();
659
+ if (decl-> getTrailingWhereClause ())
660
+ noteLoc = decl-> getLoc ( );
661
+ else if (ext && ext->isConstrainedExtension ())
668
662
noteLoc = ext->getLoc ();
669
- } else {
663
+ else
670
664
return type;
671
- }
672
- }
673
665
674
- if (noteLoc.isInvalid ())
675
- noteLoc = loc;
666
+ if (noteLoc.isInvalid ())
667
+ noteLoc = loc;
668
+ }
676
669
677
- auto result =
670
+ const auto subMap = parentTy->getContextSubstitutions (decl->getDeclContext ());
671
+ const auto genericSig = decl->getGenericSignature ();
672
+ const auto result =
678
673
TypeChecker::checkGenericArguments (
679
674
dc, loc, noteLoc, type,
680
675
genericSig->getGenericParams (),
0 commit comments