File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -5106,7 +5106,10 @@ void AttributeChecker::checkAvailableAttrs(ArrayRef<AvailableAttr *> attrs) {
51065106 if (VD->isProtocolRequirement () && !PD->isObjC ()) {
51075107 diagnoseAndRemoveAttr (
51085108 const_cast <AvailableAttr *>(attr.getParsedAttr ()),
5109- diag::unavailable_method_non_objc_protocol);
5109+ diag::unavailable_method_non_objc_protocol)
5110+ .warnInSwiftInterface (D->getDeclContext ());
5111+ // Be lenient in interfaces to accomodate @_spi_available, which has
5112+ // been accepted historically.
51105113 return ;
51115114 }
51125115 }
Original file line number Diff line number Diff line change @@ -64,3 +64,16 @@ public enum EnumWithAssociatedValues {
6464 @available ( macOS 51 , * )
6565 case introducedAtDeploymentWithAssoc( Int )
6666}
67+
68+ // CHECK-LABEL: public protocol Proto
69+ public protocol Proto {
70+ // CHECK: @available(macOS 99, *)
71+ // CHECK-NEXT: func reqIntroducedAfterDeployment()
72+ @available ( macOS 99 , * )
73+ func reqIntroducedAfterDeployment( )
74+
75+ // CHECK: @available(macOS, unavailable)
76+ // CHECK-NEXT: func reqIntroducedAsSPIAfterDeployment()
77+ @_spi_available ( macOS 99 , * )
78+ func reqIntroducedAsSPIAfterDeployment( )
79+ }
You can’t perform that action at this time.
0 commit comments