You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We added a workaround to Swift Testing (in swiftlang/swift-testing#949) to suppress this warning when certain syntax (such as ?) are seen in the expression, taking it as a hint there may be optionality. But in this issue there is no such syntax to hint on.
Also, the potential original issue I linked above involved a reference (class) type and, and there was a suspicion that was relevant to the bug. But this report is about a simpler value type.
Description
When using
try #require
inside an optional assignment, an incorrect warning ist being produced:Reproduction
Expected behavior
There should be no warning, the code is correct, as
one.value
can indeed becomenil
. Changing the code as follows does not have the warning:Environment
Swift 6.1, Xcode Version 16.3 (16E140)
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
Additional information
This was not an issue with Swift 6.0 and previous Xcode releases.
The text was updated successfully, but these errors were encountered: