@@ -345,8 +345,9 @@ static bool computeContainedByDeploymentTarget(TypeRefinementContext *TRC,
345
345
// / Returns true if the reference or any of its parents is an
346
346
// / unconditional unavailable declaration for the same platform.
347
347
static bool isInsideCompatibleUnavailableDeclaration (
348
- const Decl *D, const ExportContext &where, const AvailableAttr *attr) {
349
- auto referencedPlatform = where.getUnavailablePlatformKind ();
348
+ const Decl *D, AvailabilityContext availabilityContext,
349
+ const AvailableAttr *attr) {
350
+ auto referencedPlatform = availabilityContext.getUnavailablePlatformKind ();
350
351
if (!referencedPlatform)
351
352
return false ;
352
353
@@ -374,7 +375,7 @@ ExportContext::shouldDiagnoseDeclAsUnavailable(const Decl *D) const {
374
375
if (!attr)
375
376
return nullptr ;
376
377
377
- if (isInsideCompatibleUnavailableDeclaration (D, * this , attr))
378
+ if (isInsideCompatibleUnavailableDeclaration (D, Availability , attr))
378
379
return nullptr ;
379
380
380
381
return attr;
@@ -1496,7 +1497,8 @@ TypeChecker::checkDeclarationAvailability(const Decl *D,
1496
1497
// Skip computing potential unavailability if the declaration is explicitly
1497
1498
// unavailable and the context is also unavailable.
1498
1499
if (const AvailableAttr *Attr = AvailableAttr::isUnavailable (D))
1499
- if (isInsideCompatibleUnavailableDeclaration (D, Where, Attr))
1500
+ if (isInsideCompatibleUnavailableDeclaration (D, Where.getAvailability (),
1501
+ Attr))
1500
1502
return std::nullopt;
1501
1503
1502
1504
if (isDeclarationUnavailable (D, Where.getDeclContext (), [&Where] {
0 commit comments