@@ -903,10 +903,10 @@ Type TypeBase::adjustSuperclassMemberDeclType(const ValueDecl *baseDecl,
903903OpaqueSubstitutionKind
904904ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution (
905905 OpaqueTypeDecl *opaque) const {
906- const auto *inContext = getContext ();
907906 auto inModule = inContext ? inContext->getParentModule ()
908907 : opaque->getParentModule ();
909- return shouldPerformSubstitution (opaque, inModule, contextExpansion);
908+ return shouldPerformSubstitution (
909+ opaque, inModule, ResilienceExpansion (contextExpansion));
910910}
911911OpaqueSubstitutionKind
912912ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution (
@@ -1025,7 +1025,7 @@ operator()(SubstitutableType *maybeOpaqueType) const {
10251025 return maybeOpaqueType;
10261026 }
10271027
1028- auto subs = decl->getUniqueUnderlyingTypeSubstitutions ();
1028+ auto subs = decl->getUniqueUnderlyingTypeSubstitutions (typeCheckFunctionBodies );
10291029 // If the body of the opaque decl providing decl has not been type checked we
10301030 // don't have a underlying substitution.
10311031 if (!subs.has_value ())
@@ -1038,16 +1038,12 @@ operator()(SubstitutableType *maybeOpaqueType) const {
10381038
10391039 // Check that we are allowed to substitute the underlying type into the
10401040 // context.
1041- auto inContext = this ->getContext ();
1042- auto isContextWholeModule = this ->isWholeModule ();
1043- auto contextExpansion = this ->contextExpansion ;
10441041 if (inContext &&
10451042 partialSubstTy.findIf (
1046- [inContext, substitutionKind, isContextWholeModule,
1047- contextExpansion](Type t) -> bool {
1043+ [&](Type t) -> bool {
10481044 if (!canSubstituteTypeInto (t, inContext, substitutionKind,
1049- contextExpansion,
1050- isContextWholeModule ))
1045+ ResilienceExpansion ( contextExpansion) ,
1046+ isWholeModule ))
10511047 return true ;
10521048 return false ;
10531049 }))
@@ -1154,16 +1150,12 @@ operator()(InFlightSubstitution &IFS, Type maybeOpaqueType,
11541150
11551151 // Check that we are allowed to substitute the underlying type into the
11561152 // context.
1157- auto inContext = this ->getContext ();
1158- auto isContextWholeModule = this ->isWholeModule ();
1159- auto contextExpansion = this ->contextExpansion ;
11601153 if (inContext &&
11611154 partialSubstTy.findIf (
1162- [inContext, substitutionKind, isContextWholeModule,
1163- contextExpansion](Type t) -> bool {
1155+ [&](Type t) -> bool {
11641156 if (!canSubstituteTypeInto (t, inContext, substitutionKind,
1165- contextExpansion,
1166- isContextWholeModule ))
1157+ ResilienceExpansion ( contextExpansion) ,
1158+ isWholeModule ))
11671159 return true ;
11681160 return false ;
11691161 })) {
0 commit comments