@@ -48,34 +48,51 @@ deprecatedOnIOSButNotMacCatalyst() // no-warning
4848func introducedLaterOnMacCatalyst( ) {
4949}
5050
51+ @available ( iOS 57 . 0 , macCatalyst 56 . 0 , * )
52+ func introducedLaterOnIOS( ) {
53+ }
54+
5155// expected-note@+1 *{{add @available attribute to enclosing global function}}
5256func testPoundAvailable( ) {
5357
5458 if #available( macCatalyst 55 . 0 , * ) {
5559 introducedLaterOnMacCatalyst ( ) // expected-error {{'introducedLaterOnMacCatalyst()' is only available in Mac Catalyst 56.0 or newer}}
5660 // expected-note@-1 {{add 'if #available' version check}}
61+ introducedLaterOnIOS ( ) // expected-error {{'introducedLaterOnIOS()' is only available in Mac Catalyst 56.0 or newer}}
62+ // expected-note@-1 {{add 'if #available' version check}}
5763 }
5864
5965 // macCatalyst should win over iOS when present
6066
6167 if #available( iOS 56 . 0 , macCatalyst 55 . 0 , * ) {
6268 introducedLaterOnMacCatalyst ( ) // expected-error {{'introducedLaterOnMacCatalyst()' is only available in Mac Catalyst 56.0 or newer}}
6369 // expected-note@-1 {{add 'if #available' version check}}
70+ introducedLaterOnIOS ( ) // expected-error {{'introducedLaterOnIOS()' is only available in Mac Catalyst 56.0 or newer}}
71+ // expected-note@-1 {{add 'if #available' version check}}
6472 }
6573
6674 if #available( iOS 55 . 0 , macCatalyst 56 . 0 , * ) {
6775 introducedLaterOnMacCatalyst ( ) // no-warning
76+ introducedLaterOnIOS ( ) // no-error
77+ }
78+
79+ if #available( iOS 57 . 0 , macCatalyst 56 . 0 , * ) {
80+ introducedLaterOnMacCatalyst ( ) // no-warning
81+ introducedLaterOnIOS ( ) // no-error
6882 }
6983
7084 // iOS availability should be inherited when macCatalyst is not present
7185
7286 if #available( iOS 55 . 0 , * ) {
7387 introducedLaterOnMacCatalyst ( ) // expected-error {{'introducedLaterOnMacCatalyst()' is only available in Mac Catalyst 56.0 or newer}}
7488 // expected-note@-1 {{add 'if #available' version check}}
89+ introducedLaterOnIOS ( ) // expected-error {{'introducedLaterOnIOS()' is only available in Mac Catalyst 56.0 or newer}}
90+ // expected-note@-1 {{add 'if #available' version check}}
7591 }
7692
7793 if #available( iOS 56 . 0 , * ) {
7894 introducedLaterOnMacCatalyst ( ) // no-warning
95+ introducedLaterOnIOS ( ) // no-error
7996 }
8097
8198 // macOS availability doesn't count on macCatalyst for Swift.
0 commit comments