@@ -4728,6 +4728,7 @@ ConstraintSystem::simplifyDynamicCallableApplicableFnConstraint(
4728
4728
auto loc = getConstraintLocator (locator);
4729
4729
auto tv = createTypeVariable (loc, TVO_CanBindToLValue);
4730
4730
4731
+ // Record the 'dynamicallyCall` method overload set.
4731
4732
SmallVector<OverloadChoice, 4 > choices;
4732
4733
for (auto candidate : candidates) {
4733
4734
TC.validateDecl (candidate);
@@ -4736,8 +4737,6 @@ ConstraintSystem::simplifyDynamicCallableApplicableFnConstraint(
4736
4737
OverloadChoice (type2, candidate, FunctionRefKind::SingleApply));
4737
4738
}
4738
4739
if (choices.empty ()) return SolutionKind::Error;
4739
-
4740
- // Record the 'dynamicallyCall` method overload set.
4741
4740
addOverloadSet (tv, choices, DC, loc);
4742
4741
4743
4742
// Create a type variable for the argument to the `dynamicallyCall` method.
@@ -4751,15 +4750,15 @@ ConstraintSystem::simplifyDynamicCallableApplicableFnConstraint(
4751
4750
Type argumentType;
4752
4751
if (!useKwargsMethod) {
4753
4752
auto arrayLitProto =
4754
- ctx.getProtocol (KnownProtocolKind::ExpressibleByArrayLiteral);
4753
+ ctx.getProtocol (KnownProtocolKind::ExpressibleByArrayLiteral);
4755
4754
addConstraint (ConstraintKind::ConformsTo, tvParam,
4756
4755
arrayLitProto->getDeclaredType (), locator);
4757
4756
auto elementAssocType = cast<AssociatedTypeDecl>(
4758
4757
arrayLitProto->lookupDirect (ctx.Id_ArrayLiteralElement ).front ());
4759
4758
argumentType = DependentMemberType::get (tvParam, elementAssocType);
4760
4759
} else {
4761
4760
auto dictLitProto =
4762
- ctx.getProtocol (KnownProtocolKind::ExpressibleByDictionaryLiteral);
4761
+ ctx.getProtocol (KnownProtocolKind::ExpressibleByDictionaryLiteral);
4763
4762
addConstraint (ConstraintKind::ConformsTo, tvParam,
4764
4763
dictLitProto->getDeclaredType (), locator);
4765
4764
auto valueAssocType = cast<AssociatedTypeDecl>(
@@ -4770,6 +4769,7 @@ ConstraintSystem::simplifyDynamicCallableApplicableFnConstraint(
4770
4769
// Argument type can default to `Any`.
4771
4770
addConstraint (ConstraintKind::Defaultable, argumentType,
4772
4771
ctx.TheAnyType , locator);
4772
+
4773
4773
// All dynamic call parameter types must be convertible to the argument type.
4774
4774
for (auto i : indices (func1->getParams ())) {
4775
4775
auto param = func1->getParams ()[i];
0 commit comments