Confusing compiler error "Value of optional type 'T?' must be unwrapped to a value of type 'T'" when comparing optional with non-optional #76202
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
When comparing an optional with a non-optional with
==
where the type doesn't conform toEquatable
, the compiler shows a confusing errorValue of optional type 'T?' must be unwrapped to a value of type 'T'
.Reproduction
Expected behavior
The compiler should show the error
which correctly appears when removing the constraint
where T.RawValue == String
.Environment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: