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) {
5106
5106
if (VD->isProtocolRequirement () && !PD->isObjC ()) {
5107
5107
diagnoseAndRemoveAttr (
5108
5108
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.
5110
5113
return ;
5111
5114
}
5112
5115
}
Original file line number Diff line number Diff line change @@ -64,3 +64,16 @@ public enum EnumWithAssociatedValues {
64
64
@available ( macOS 51 , * )
65
65
case introducedAtDeploymentWithAssoc( Int )
66
66
}
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