Skip to content

Commit 001db3a

Browse files
committed
Fix testcase now that we get warnings instead of errors
1 parent 0e98bf2 commit 001db3a

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() { }
@@ -322,6 +323,7 @@ func check() async {
322323
_ = await BazFrame(size: 0)
323324
}
324325

326+
@available(SwiftStdlib 5.5, *)
325327
func testSender(
326328
sender: NXSender,
327329
sendableObject: SendableClass,
@@ -333,7 +335,7 @@ func testSender(
333335
nonSendableGeneric: GenericObject<SendableClass>,
334336
ptr: UnsafeMutableRawPointer,
335337
stringArray: [String]
336-
) {
338+
) async {
337339
sender.sendAny(sendableObject)
338340
sender.sendAny(nonSendableObject)
339341
// expected-warning@-1 {{conformance of 'NonSendableClass' to 'Sendable' is unavailable}}
@@ -352,22 +354,22 @@ func testSender(
352354

353355
sender.sendProto(sendableProtos)
354356
sender.sendProto(nonSendableProtos)
355-
// expected-error@-1 {{argument type 'any LabellyProtocol & ObjCClub' does not conform to expected type 'Sendable'}}
356-
// FIXME(rdar://89992095): Should be a warning because we're in -warn-concurrency
357+
// expected-warning@-1 {{type 'any LabellyProtocol & ObjCClub' does not conform to the 'Sendable' protocol}}
357358

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

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

367367
sender.sendGeneric(sendableGeneric)
368+
// expected-warning@-1{{type 'GenericObject<SendableClass>' does not conform to the 'Sendable' protocol}}
369+
// FIXME: Shouldn't warn
370+
368371
sender.sendGeneric(nonSendableGeneric)
369-
// expected-error@-1 {{argument type 'GenericObject<SendableClass>' does not conform to expected type 'Sendable'}}
370-
// FIXME(rdar://89992095): Should be a warning because we're in -warn-concurrency
372+
// expected-warning@-1 {{type 'GenericObject<SendableClass>' does not conform to the 'Sendable' protocol}}
371373

372374
sender.sendPtr(ptr)
373375
sender.sendStringArray(stringArray)

0 commit comments

Comments
 (0)