mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Bail out of inference from default arguments if there
is no parameter list for the callee. This can happen when the callee is a closure that has been assigned to a variable.
This commit is contained in:
@@ -1753,10 +1753,12 @@ static ConstraintSystem::TypeMatchResult matchCallArguments(
|
||||
|
||||
if (ctx.TypeCheckerOpts.EnableTypeInferenceFromDefaultArguments) {
|
||||
auto *paramList = getParameterList(callee);
|
||||
auto *PD = paramList->get(paramIdx);
|
||||
if (!paramList)
|
||||
continue;
|
||||
|
||||
// There is nothing to infer if parameter doesn't have any
|
||||
// generic parameters in its type.
|
||||
auto *PD = paramList->get(paramIdx);
|
||||
if (!PD->getInterfaceType()->hasTypeParameter())
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user