Skip to content

Commit 5bac07b

Browse files
committed
Add proper availability annotations for test
1 parent 049f1ac commit 5bac07b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/Macros/macro_expand_body.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extension String: ConjureRemoteValue {
2121
static func conjureValue() -> String { "" }
2222
}
2323

24+
@available(SwiftStdlib 5.1, *)
2425
func remoteCall<Result: ConjureRemoteValue>(function: String, arguments: [String: Any]) async throws -> Result {
2526
let printedArgs = arguments.keys.sorted().map { key in
2627
"\(key): \(arguments[key]!)"
@@ -29,16 +30,19 @@ func remoteCall<Result: ConjureRemoteValue>(function: String, arguments: [String
2930
return Result.conjureValue()
3031
}
3132

33+
@available(SwiftStdlib 5.1, *)
3234
@Remote
3335
func f(a: Int, b: String) async throws -> String
3436

3537

38+
@available(SwiftStdlib 5.1, *)
3639
@Remote
3740
func g(a: Int, b: String) async throws -> String {
3841
doesNotTypeCheck()
3942
}
4043

4144
#if compiler(>=5.11) && TEST_DIAGNOSTICS
45+
@available(SwiftStdlib 5.1, *)
4246
@Remote
4347
func h(a: Int, b: String) async throws -> String {
4448
does not
@@ -47,8 +51,10 @@ func h(a: Int, b: String) async throws -> String {
4751
}
4852
#endif
4953

50-
// CHECK: Remote call f(a: 5, b: Hello)
51-
print(try await f(a: 5, b: "Hello"))
54+
if #available(SwiftStdlib 5.1, *) {
55+
// CHECK: Remote call f(a: 5, b: Hello)
56+
print(try await f(a: 5, b: "Hello"))
5257

53-
// CHECK: Remote call g(a: 5, b: World)
54-
print(try await g(a: 5, b: "World"))
58+
// CHECK: Remote call g(a: 5, b: World)
59+
print(try await g(a: 5, b: "World"))
60+
}

0 commit comments

Comments
 (0)