[ConstraintSystem] Don't allow dollar prefixes in argument labels unless

the parameter has an attached property wrapper.
This commit is contained in:
Holly Borla
2021-02-25 17:42:27 -08:00
parent c29eecd0b6
commit db387273f6
6 changed files with 47 additions and 17 deletions

View File

@@ -1420,9 +1420,10 @@ ConstraintSystem::TypeMatchResult constraints::matchCallArguments(
cs, cs.getConstraintLocator(loc)));
}
if (auto *param = paramInfo.getPropertyWrapperParam(argIdx)) {
auto argLabel = argInfo->Labels[argIdx];
if (cs.applyPropertyWrapperParameter(paramTy, argTy, const_cast<ParamDecl *>(param),
auto *wrappedParam = paramInfo.getPropertyWrapperParam(argIdx);
auto argLabel = argument.getLabel();
if (wrappedParam || argLabel.hasDollarPrefix()) {
if (cs.applyPropertyWrapperParameter(paramTy, argTy, const_cast<ParamDecl *>(wrappedParam),
argLabel, subKind, locator).isFailure()) {
return cs.getTypeMatchFailure(loc);
}