Skip to content

Commit 4d2a1ba

Browse files
committed
Parse: Accept @available(DomainName).
For now `-enable-experimental-feature CustomAvailability` is required to accept this spelling, though.
1 parent f115676 commit 4d2a1ba

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ ParserResult<AvailableAttr> Parser::parseExtendedAvailabilitySpecList(
537537
}
538538
}
539539

540-
if (!AnyAnnotations) {
540+
if (!AnyAnnotations &&
541+
!Context.LangOpts.hasFeature(Feature::CustomAvailability)) {
541542
diagnose(Tok.getLoc(), diag::attr_expected_comma, AttrName,
542543
/*isDeclModifier*/ false);
543544
}

test/attr/attr_availability_custom_domains.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
// REQUIRES: swift_feature_CustomAvailability
1010

11-
// expected-error@+1 {{expected ',' in 'available' attribute}}
1211
@available(EnabledDomain) // expected-warning {{unknown platform 'EnabledDomain' for attribute 'available'}}
1312
func availableInEnabledDomain() { }
1413

@@ -18,11 +17,9 @@ func availableInDisabledDomain() { }
1817
@available(RedefinedDomain, deprecated, message: "Use something else") // expected-warning {{unknown platform 'RedefinedDomain' for attribute 'available'}}
1918
func availableInRedefinedDomain() { }
2019

21-
// expected-error@+1 {{expected ',' in 'available' attribute}}
2220
@available(DynamicDomain) // expected-warning {{unknown platform 'DynamicDomain' for attribute 'available'}}
2321
func availableInDynamicDomain() { }
2422

25-
// expected-error@+1 {{expected ',' in 'available' attribute}}
2623
@available(UnknownDomain) // expected-warning {{unknown platform 'UnknownDomain' for attribute 'available'}}
2724
func availableInUnknownDomain() { }
2825

0 commit comments

Comments
 (0)