[SR-13109] compactMap behaves differently when storing result in an optional variable #55555
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Attachment: Download
Additional Detail from JIRA
md5: 0cd8401bc530790f3f501949662c68e7
Issue Description:
Consider the following playground code -
Output - [Optional(86), Optional(45), nil, Optional(76)]
Expected Output - [Optional(86), Optional(45), Optional(76)]
compactMap() should return non-optional values only. After casting it to [Int?], getting nil as well.
The text was updated successfully, but these errors were encountered: