mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Introduce SemanticAvailabilitySpec.
It wraps an type-checked `AvailabilitySpec`, which guarantees that the spec has a valid `AvailabilityDomain` associated with it. This will unblock moving AvailabilitySpec domain resolution from parsing to sema.
This commit is contained in:
@@ -1052,11 +1052,12 @@ getConditionalMemberFromIfStmt(const IfStmt *ifStmt,
|
||||
}
|
||||
for (auto elt : ifStmt->getCond()) {
|
||||
if (elt.getKind() == StmtConditionElement::CK_Availability) {
|
||||
for (auto *Q : elt.getAvailability()->getQueries()) {
|
||||
if (Q->getPlatform() != PlatformKind::none) {
|
||||
auto spec = BuilderValue::ConditionalMember::AvailabilitySpec(
|
||||
*Q->getDomain(), Q->getVersion());
|
||||
AvailabilitySpecs.push_back(spec);
|
||||
for (auto spec :
|
||||
elt.getAvailability()->getSemanticAvailabilitySpecs(declContext)) {
|
||||
if (spec.getDomain().isPlatform()) {
|
||||
AvailabilitySpecs.push_back(
|
||||
BuilderValue::ConditionalMember::AvailabilitySpec(
|
||||
spec.getDomain(), spec.getVersion()));
|
||||
}
|
||||
}
|
||||
memberKind = BuilderValue::LimitedAvailability;
|
||||
|
||||
Reference in New Issue
Block a user