mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Property Wrappers] Add a constraint fix and diagnostic for the case
where the programmer tries to pass a projection argument to a wrapped parameter without 'var projectedValue'.
This commit is contained in:
@@ -1422,8 +1422,10 @@ ConstraintSystem::TypeMatchResult constraints::matchCallArguments(
|
||||
|
||||
if (auto *param = paramInfo.getPropertyWrapperParam(argIdx)) {
|
||||
auto argLabel = argInfo->Labels[argIdx];
|
||||
cs.applyPropertyWrapperParameter(paramTy, argTy, const_cast<ParamDecl *>(param),
|
||||
argLabel, subKind, locator);
|
||||
if (cs.applyPropertyWrapperParameter(paramTy, argTy, const_cast<ParamDecl *>(param),
|
||||
argLabel, subKind, locator).isFailure()) {
|
||||
return cs.getTypeMatchFailure(loc);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -10662,6 +10664,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
|
||||
case FixKind::SkipUnhandledConstructInResultBuilder:
|
||||
case FixKind::UsePropertyWrapper:
|
||||
case FixKind::UseWrappedValue:
|
||||
case FixKind::AddProjectedValue:
|
||||
case FixKind::ExpandArrayIntoVarargs:
|
||||
case FixKind::UseRawValue:
|
||||
case FixKind::ExplicitlyConstructRawRepresentable:
|
||||
|
||||
Reference in New Issue
Block a user