mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Introduce a Swift runtime availability domain.
Add support for the `Swift` availability domain, which represents availability with respect to the Swift runtime. Use of this domain is restricted by the experimental feature `SwiftRuntimeAvailability`.
This commit is contained in:
@@ -640,6 +640,7 @@ computeDeclRuntimeAvailability(const Decl *decl) {
|
||||
if (!domain.isActive(ctx) && !isTargetDomain)
|
||||
continue;
|
||||
|
||||
// FIXME: [runtime availability] Update this?
|
||||
if (!domain.isRoot())
|
||||
continue;
|
||||
|
||||
@@ -855,7 +856,8 @@ SemanticAvailableAttrRequest::evaluate(swift::Evaluator &evaluator,
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (domain->isSwiftLanguageMode() || domain->isPackageDescription()) {
|
||||
if (domain->isSwiftLanguageMode() || domain->isPackageDescription() ||
|
||||
domain->isSwiftRuntime()) {
|
||||
switch (attr->getKind()) {
|
||||
case AvailableAttr::Kind::Deprecated:
|
||||
diags.diagnose(attrLoc,
|
||||
|
||||
Reference in New Issue
Block a user