|
3 | 3 | // RUN: %empty-directory(%t)
|
4 | 4 |
|
5 | 5 | /// Using the flag directly raises warnings and fixits.
|
6 |
| -// RUN: %swiftc_driver -typecheck -parse-as-library -Xfrontend -verify %s \ |
7 |
| -// RUN: -target %target-cpu-apple-macosx10.10 -require-explicit-availability \ |
8 |
| -// RUN: -require-explicit-availability-target "macOS 10.10" |
9 |
| -// RUN: %swiftc_driver -typecheck -parse-as-library -Xfrontend -verify %s \ |
10 |
| -// RUN: -target %target-cpu-apple-macosx10.10 -require-explicit-availability=warn \ |
11 |
| -// RUN: -require-explicit-availability-target "macOS 10.10" |
| 6 | +// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s \ |
| 7 | +// RUN: -target %target-cpu-apple-macosx10.10 -package-name Foo \ |
| 8 | +// RUN: -require-explicit-availability -require-explicit-availability-target "macOS 10.10" |
| 9 | +// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s \ |
| 10 | +// RUN: -target %target-cpu-apple-macosx10.10 -package-name Foo \ |
| 11 | +// RUN: -require-explicit-availability=warn -require-explicit-availability-target "macOS 10.10" |
12 | 12 |
|
13 | 13 | /// Using -library-level api defaults to enabling warnings, without fixits.
|
14 | 14 | // RUN: sed -e "s/}} {{.*/}}/" < %s > %t/NoFixits.swift
|
15 | 15 | // RUN: %target-swift-frontend -typecheck -parse-as-library -verify %t/NoFixits.swift \
|
16 |
| -// RUN: -target %target-cpu-apple-macosx10.10 -library-level api |
| 16 | +// RUN: -target %target-cpu-apple-macosx10.10 -package-name Foo -library-level api |
17 | 17 |
|
18 | 18 | /// Explicitly disable the diagnostic.
|
19 | 19 | // RUN: sed -e 's/xpected-warning/not-something-expected/' < %s > %t/None.swift
|
20 | 20 | // RUN: %target-swift-frontend -typecheck -parse-as-library -verify %t/None.swift \
|
21 |
| -// RUN: -target %target-cpu-apple-macosx10.10 -require-explicit-availability=ignore \ |
22 |
| -// RUN: -require-explicit-availability-target "macOS 10.10" -library-level api |
| 21 | +// RUN: -target %target-cpu-apple-macosx10.10 -package-name Foo -library-level api \ |
| 22 | +// RUN: -require-explicit-availability=ignore -require-explicit-availability-target "macOS 10.10" |
23 | 23 |
|
24 | 24 | /// Upgrade the diagnostic to an error.
|
25 | 25 | // RUN: sed -e "s/xpected-warning/xpected-error/" < %s > %t/Errors.swift
|
26 | 26 | // RUN: %target-swift-frontend -typecheck -parse-as-library -verify %t/Errors.swift \
|
27 |
| -// RUN: -target %target-cpu-apple-macosx10.10 -require-explicit-availability=error \ |
28 |
| -// RUN: -require-explicit-availability-target "macOS 10.10" |
| 27 | +// RUN: -target %target-cpu-apple-macosx10.10 -package-name Foo \ |
| 28 | +// RUN: -require-explicit-availability=error -require-explicit-availability-target "macOS 10.10" |
29 | 29 |
|
30 | 30 | /// Error on an invalid argument.
|
31 | 31 | // RUN: not %target-swift-frontend -typecheck %s -require-explicit-availability=NotIt 2>&1 \
|
@@ -58,7 +58,9 @@ public func missingIntro() { } // expected-warning {{public declarations should
|
58 | 58 | @available(iOS 9.0, *)
|
59 | 59 | public func missingTargetPlatform() { } // expected-warning {{public declarations should have an availability attribute with an introduction version}} {{-1:1-1=@available(macOS 10.10, *)\n}}
|
60 | 60 |
|
61 |
| -func privateFunc() { } |
| 61 | +private func privateFunc() { } |
| 62 | +internal func internalFunc() { } |
| 63 | +package func packageFunc() { } |
62 | 64 |
|
63 | 65 | @_alwaysEmitIntoClient
|
64 | 66 | public func alwaysEmitted() { }
|
@@ -113,6 +115,18 @@ extension S {
|
113 | 115 | extension S {
|
114 | 116 | internal func dontWarnWithoutPublicMembers() { }
|
115 | 117 | private func dontWarnWithoutPublicMembers1() { }
|
| 118 | + package func dontWarnWithoutPublicMembers2() { } |
| 119 | +} |
| 120 | + |
| 121 | +extension S { |
| 122 | + @_spi(SPIsAreOK) |
| 123 | + public func dontWarnWithSPIMembers() {} |
| 124 | + |
| 125 | + @available(macOS, unavailable) |
| 126 | + public func dontWarnWithUnavailableMembers() { } |
| 127 | + |
| 128 | + @_alwaysEmitIntoClient |
| 129 | + public func dontWarnWithAEICMembers() { } |
116 | 130 | }
|
117 | 131 |
|
118 | 132 | // An empty extension should be ok.
|
|
0 commit comments