mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #42036 from xedin/dont-infer-from-magic-defaults
[TypeChecker] SE-0347: Avoid type inference from caller-site defaults
This commit is contained in:
@@ -1782,6 +1782,11 @@ static ConstraintSystem::TypeMatchResult matchCallArguments(
|
||||
if (!PD->getInterfaceType()->hasTypeParameter())
|
||||
continue;
|
||||
|
||||
// The type of the default value is going to be determined
|
||||
// based on a type deduced for the parameter at this call site.
|
||||
if (PD->hasCallerSideDefaultExpr())
|
||||
continue;
|
||||
|
||||
auto defaultExprType = PD->getTypeOfDefaultExpr();
|
||||
|
||||
// A caller side default.
|
||||
|
||||
Reference in New Issue
Block a user