mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #27995 from theblixguy/fix/SR-11684
[PropertyWrappers] Mark the property as invalid when there is a mismatch with wrappedValue type
This commit is contained in:
@@ -2980,6 +2980,16 @@ bool ConstraintSystem::repairFailures(
|
||||
locator);
|
||||
}
|
||||
|
||||
// Let's not complain about argument type mismatch if we have a synthesized
|
||||
// wrappedValue initializer, because we already emit a diagnostic for a
|
||||
// type mismatch between the property's type and the wrappedValue type.
|
||||
if (auto CE = dyn_cast<CallExpr>(loc->getAnchor())) {
|
||||
if (CE->isImplicit() && !CE->getArgumentLabels().empty() &&
|
||||
CE->getArgumentLabels().front() == getASTContext().Id_wrappedValue) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
conversionsOrFixes.push_back(
|
||||
AllowArgumentMismatch::create(*this, lhs, rhs, loc));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user