swiftlang / swift-corelibs-xctest

The XCTest Project, A Swift core library for providing unit test support
swift.org
Apache License 2.0
1.15k stars 267 forks source link

XCTWaiter.subsystemQueue.sync is always non-null #426

Closed AreaZR closed 1 year ago

AreaZR commented 1 year ago

No need to have the null check via "?"

stmontgomery commented 1 year ago

This is optional because the value returned by the closure passed to this call to XCTWaiter.subsystemQueue.sync is optional. It's returning the value queue_didFulfillHandler, which is a property whose type is an optional closure. So I believe this is correct as written

I would expect this branch to not build successfully as a result… have you tried?