@@ -715,7 +715,7 @@ static std::pair<AbstractionPattern, CanType> updateResultTypeForForeignError(
715
715
// / If we ever add that ability, it will be a different capture list
716
716
// / from the function to which the argument is attached.
717
717
static void
718
- lowerCaptureContextParameters (TypeConverter &TC, AnyFunctionRef function,
718
+ lowerCaptureContextParameters (TypeConverter &TC, SILDeclRef function,
719
719
CanGenericSignature genericSig,
720
720
ResilienceExpansion expansion,
721
721
SmallVectorImpl<SILParameterInfo> &inputs) {
@@ -725,8 +725,7 @@ lowerCaptureContextParameters(TypeConverter &TC, AnyFunctionRef function,
725
725
// canonicalize references to the generic parameters that may appear in
726
726
// non-canonical types in that context. We need the original generic
727
727
// signature from the AST for that.
728
- auto origGenericSig = function.getGenericSignature ();
729
-
728
+ auto origGenericSig = function.getAnyFunctionRef ()->getGenericSignature ();
730
729
auto loweredCaptures = TC.getLoweredLocalCaptures (function);
731
730
732
731
for (auto capture : loweredCaptures.getCaptures ()) {
@@ -999,18 +998,12 @@ static CanSILFunctionType getSILFunctionType(
999
998
yields, coroutineKind);
1000
999
1001
1000
// Lower the capture context parameters, if any.
1002
- //
1003
- // *NOTE* Currently default arg generators can not capture anything.
1004
- // If we ever add that ability, it will be a different capture list
1005
- // from the function to which the argument is attached.
1006
- if (constant && !constant->isDefaultArgGenerator ()) {
1007
- if (auto function = constant->getAnyFunctionRef ()) {
1008
- auto expansion = ResilienceExpansion::Maximal;
1009
- if (constant->isSerialized ())
1010
- expansion = ResilienceExpansion::Minimal;
1011
- lowerCaptureContextParameters (TC, *function, genericSig, expansion,
1012
- inputs);
1013
- }
1001
+ if (constant && constant->getAnyFunctionRef ()) {
1002
+ auto expansion = ResilienceExpansion::Maximal;
1003
+ if (constant->isSerialized ())
1004
+ expansion = ResilienceExpansion::Minimal;
1005
+ lowerCaptureContextParameters (TC, *constant, genericSig, expansion,
1006
+ inputs);
1014
1007
}
1015
1008
1016
1009
auto calleeConvention = ParameterConvention::Direct_Unowned;
0 commit comments