@@ -903,10 +903,10 @@ Type TypeBase::adjustSuperclassMemberDeclType(const ValueDecl *baseDecl,
903
903
OpaqueSubstitutionKind
904
904
ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution (
905
905
OpaqueTypeDecl *opaque) const {
906
- const auto *inContext = getContext ();
907
906
auto inModule = inContext ? inContext->getParentModule ()
908
907
: opaque->getParentModule ();
909
- return shouldPerformSubstitution (opaque, inModule, contextExpansion);
908
+ return shouldPerformSubstitution (
909
+ opaque, inModule, ResilienceExpansion (contextExpansion));
910
910
}
911
911
OpaqueSubstitutionKind
912
912
ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution (
@@ -1025,7 +1025,7 @@ operator()(SubstitutableType *maybeOpaqueType) const {
1025
1025
return maybeOpaqueType;
1026
1026
}
1027
1027
1028
- auto subs = decl->getUniqueUnderlyingTypeSubstitutions ();
1028
+ auto subs = decl->getUniqueUnderlyingTypeSubstitutions (typeCheckFunctionBodies );
1029
1029
// If the body of the opaque decl providing decl has not been type checked we
1030
1030
// don't have a underlying substitution.
1031
1031
if (!subs.has_value ())
@@ -1038,16 +1038,12 @@ operator()(SubstitutableType *maybeOpaqueType) const {
1038
1038
1039
1039
// Check that we are allowed to substitute the underlying type into the
1040
1040
// context.
1041
- auto inContext = this ->getContext ();
1042
- auto isContextWholeModule = this ->isWholeModule ();
1043
- auto contextExpansion = this ->contextExpansion ;
1044
1041
if (inContext &&
1045
1042
partialSubstTy.findIf (
1046
- [inContext, substitutionKind, isContextWholeModule,
1047
- contextExpansion](Type t) -> bool {
1043
+ [&](Type t) -> bool {
1048
1044
if (!canSubstituteTypeInto (t, inContext, substitutionKind,
1049
- contextExpansion,
1050
- isContextWholeModule ))
1045
+ ResilienceExpansion ( contextExpansion) ,
1046
+ isWholeModule ))
1051
1047
return true ;
1052
1048
return false ;
1053
1049
}))
@@ -1154,16 +1150,12 @@ operator()(InFlightSubstitution &IFS, Type maybeOpaqueType,
1154
1150
1155
1151
// Check that we are allowed to substitute the underlying type into the
1156
1152
// context.
1157
- auto inContext = this ->getContext ();
1158
- auto isContextWholeModule = this ->isWholeModule ();
1159
- auto contextExpansion = this ->contextExpansion ;
1160
1153
if (inContext &&
1161
1154
partialSubstTy.findIf (
1162
- [inContext, substitutionKind, isContextWholeModule,
1163
- contextExpansion](Type t) -> bool {
1155
+ [&](Type t) -> bool {
1164
1156
if (!canSubstituteTypeInto (t, inContext, substitutionKind,
1165
- contextExpansion,
1166
- isContextWholeModule ))
1157
+ ResilienceExpansion ( contextExpansion) ,
1158
+ isWholeModule ))
1167
1159
return true ;
1168
1160
return false ;
1169
1161
})) {
0 commit comments