File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 14
14
#include " swift/AST/ASTContext.h"
15
15
#include " swift/AST/ASTWalker.h"
16
16
#include " swift/AST/AccessScope.h"
17
- #include " swift/AST/AvailabilityInference.h"
17
+ #include " swift/AST/AvailabilityConstraint.h"
18
+ #include " swift/AST/AvailabilityContext.h"
18
19
#include " swift/AST/ClangModuleLoader.h"
19
20
#include " swift/AST/DiagnosticsSema.h"
20
21
#include " swift/AST/Expr.h"
@@ -1750,16 +1751,10 @@ bool DeclContext::isAlwaysAvailableConformanceContext() const {
1750
1751
if (ext == nullptr )
1751
1752
return true ;
1752
1753
1753
- if (ext->isUnavailable ())
1754
- return false ;
1755
-
1754
+ // Check whether the extension is always available relative to the deployment
1755
+ // target.
1756
1756
auto &ctx = getASTContext ();
1757
-
1758
- // FIXME: [availability] Query AvailabilityContext, not platform range.
1759
- AvailabilityRange conformanceAvailability{
1760
- AvailabilityInference::availableRange (ext)};
1761
-
1762
- auto deploymentTarget = AvailabilityRange::forDeploymentTarget (ctx);
1763
-
1764
- return deploymentTarget.isContainedIn (conformanceAvailability);
1757
+ auto deploymentTarget = AvailabilityContext::forDeploymentTarget (ctx);
1758
+ auto constraints = getAvailabilityConstraintsForDecl (ext, deploymentTarget);
1759
+ return !constraints.getPrimaryConstraint ();
1765
1760
}
You can’t perform that action at this time.
0 commit comments