We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isMisplacedMissingArgument
1 parent 859106e commit e40d4e4Copy full SHA for e40d4e4
lib/Sema/CSDiagnostics.cpp
@@ -5580,6 +5580,12 @@ bool MissingArgumentsFailure::isMisplacedMissingArgument(
5580
auto argType = solution.simplifyType(solution.getType(unaryArg));
5581
auto paramType = fnType->getParams()[1].getPlainType();
5582
5583
+ if (isExpr<ClosureExpr>(unaryArg) && argType->is<UnresolvedType>()) {
5584
+ auto unwrappedParamTy = paramType->lookThroughAllOptionalTypes();
5585
+ if (unwrappedParamTy->is<FunctionType>() || unwrappedParamTy->isAny())
5586
+ return true;
5587
+ }
5588
+
5589
return TypeChecker::isConvertibleTo(argType, paramType, solution.getDC());
5590
}
5591
0 commit comments