Skip to content

Commit 57f9714

Browse files
committed
Fix testcase now that we get warnings instead of errors
1 parent bc1390e commit 57f9714

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/ClangImporter/objc_async.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// REQUIRES: concurrency
55
import Foundation
66
import ObjCConcurrency
7+
// expected-remark@-1{{add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'ObjCConcurrency'}}
78

89
@available(SwiftStdlib 5.5, *)
910
@MainActor func onlyOnMainActor() { }
@@ -314,6 +315,7 @@ func check() async {
314315
_ = await BazFrame(size: 0)
315316
}
316317

318+
@available(SwiftStdlib 5.5, *)
317319
func testSender(
318320
sender: NXSender,
319321
sendableObject: SendableClass,
@@ -325,7 +327,7 @@ func testSender(
325327
nonSendableGeneric: GenericObject<SendableClass>,
326328
ptr: UnsafeMutableRawPointer,
327329
stringArray: [String]
328-
) {
330+
) async {
329331
sender.sendAny(sendableObject)
330332
sender.sendAny(nonSendableObject)
331333
// expected-warning@-1 {{conformance of 'NonSendableClass' to 'Sendable' is unavailable}}
@@ -344,22 +346,22 @@ func testSender(
344346

345347
sender.sendProto(sendableProtos)
346348
sender.sendProto(nonSendableProtos)
347-
// expected-error@-1 {{argument type 'any LabellyProtocol & ObjCClub' does not conform to expected type 'Sendable'}}
348-
// FIXME(rdar://89992095): Should be a warning because we're in -warn-concurrency
349+
// expected-warning@-1 {{type 'any LabellyProtocol & ObjCClub' does not conform to the 'Sendable' protocol}}
349350

350351
sender.sendProtos(sendableProtos)
351352
sender.sendProtos(nonSendableProtos)
352-
// expected-error@-1 {{argument type 'any LabellyProtocol & ObjCClub' does not conform to expected type 'Sendable'}}
353-
// FIXME(rdar://89992095): Should be a warning because we're in -warn-concurrency
353+
// expected-warning@-1 {{type 'any LabellyProtocol & ObjCClub' does not conform to the 'Sendable' protocol}}
354354

355355
sender.sendAnyArray([sendableObject])
356356
sender.sendAnyArray([nonSendableObject])
357-
// expected-warning@-1 {{conformance of 'NonSendableClass' to 'Sendable' is unavailable}}
357+
// expected-warning@-1 {{conformance of 'NonSendableClass' to 'Sendable' is unavailable; this is an error in Swift 6}}
358358

359359
sender.sendGeneric(sendableGeneric)
360+
// expected-warning@-1{{type 'GenericObject<SendableClass>' does not conform to the 'Sendable' protocol}}
361+
// FIXME: Shouldn't warn
362+
360363
sender.sendGeneric(nonSendableGeneric)
361-
// expected-error@-1 {{argument type 'GenericObject<SendableClass>' does not conform to expected type 'Sendable'}}
362-
// FIXME(rdar://89992095): Should be a warning because we're in -warn-concurrency
364+
// expected-warning@-1 {{type 'GenericObject<SendableClass>' does not conform to the 'Sendable' protocol}}
363365

364366
sender.sendPtr(ptr)
365367
sender.sendStringArray(stringArray)

0 commit comments

Comments
 (0)