mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Replace TypeChecker::checkDeclarationAvailability().
Adopt `getUnmetDeclAvailabilityRequirement()` instead.
This commit is contained in:
@@ -4897,12 +4897,12 @@ bool ConstraintSystem::isReadOnlyKeyPathComponent(
|
||||
// If the setter is unavailable, then the keypath ought to be read-only
|
||||
// in this context.
|
||||
if (auto setter = storage->getOpaqueAccessor(AccessorKind::Set)) {
|
||||
ExportContext where = ExportContext::forFunctionBody(DC, referenceLoc);
|
||||
auto maybeUnavail =
|
||||
TypeChecker::checkDeclarationAvailability(setter, where);
|
||||
if (maybeUnavail.has_value()) {
|
||||
// FIXME: Fully unavailable setters should cause the key path to be
|
||||
// readonly too.
|
||||
auto unmetRequirement =
|
||||
getUnmetDeclAvailabilityRequirement(setter, DC, referenceLoc);
|
||||
if (unmetRequirement && unmetRequirement->isConditionallySatisfiable())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user