Improve error message for type mismatch between any P
and (any P)?
#60730
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
good first issue
Good for newcomers
If you try to pass a value of type
(any P)?
to an argument of typeany P
, Swift should produce an error telling you to unwrap the optional. Instead, it tells you that(any P)?
doesn’t conform toP
, which is confusing, and the user probably meant to unwrap the argument anyway.The constraint system currently applies the
MissingConformance
fix when solving for thetakesP(value)
expression. Instead, it should identify that the wrapped type of the argument matches the parameter type, and apply theForceOptional
fix.This is also tracked by rdar://94037733
The text was updated successfully, but these errors were encountered: