@@ -917,36 +917,6 @@ ConstraintSystem::TypeMatchResult constraints::matchCallArguments(
917
917
argsWithLabels.append (args.begin (), args.end ());
918
918
AnyFunctionType::relabelParams (argsWithLabels, argLabels);
919
919
920
- // FIXME: Remove this. It's functionally identical to the real code
921
- // path below, except for some behavioral differences in solution ranking
922
- // that I don't understand.
923
- if (params.size () == 1 &&
924
- args.size () == 1 &&
925
- params[0 ].getLabel ().empty () &&
926
- args[0 ].getLabel ().empty () &&
927
- !params[0 ].getParameterFlags ().isInOut () &&
928
- !args[0 ].getParameterFlags ().isInOut () &&
929
- params[0 ].getPlainType ()->isAny ()) {
930
- auto argType = args[0 ].getPlainType ();
931
-
932
- // Disallow assignment of noescape function to parameter of type
933
- // Any. Allowing this would allow these functions to escape.
934
- if (auto *fnTy = argType->getAs <AnyFunctionType>()) {
935
- if (fnTy->isNoEscape ()) {
936
- auto *loc = cs.getConstraintLocator (locator);
937
- // Allow assigned of 'no-escape' function with recorded fix.
938
- if (cs.shouldAttemptFixes ()) {
939
- if (!cs.recordFix (MarkExplicitlyEscaping::create (cs, loc)))
940
- return cs.getTypeMatchSuccess ();
941
- }
942
-
943
- return cs.getTypeMatchFailure (locator);
944
- }
945
- }
946
-
947
- return cs.getTypeMatchSuccess ();
948
- }
949
-
950
920
// Match up the call arguments to the parameters.
951
921
SmallVector<ParamBinding, 4 > parameterBindings;
952
922
ArgumentFailureTracker listener (cs, parameterBindings, locator);
0 commit comments