[SR-7239] Optional(nil) ? #49787
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Attachment: Download
Environment
Apple Swift version 4.1 (swiftlang-902.0.43 clang-902.0.37.1)
Target: x86_64-apple-darwin17.4.0
Additional Detail from JIRA
md5: 15dc48b497ed49c70364a0b2f8640840
Issue Description:
See this code:
I thought the nonnulls will be [1,2]. but actual value was [nil, 1, 2]. compactMap() didn't remove the nil.
print(optionals) outputs "[Optional(nil), Optional(Optional(1)), Optional(Optional(2))]"
Is this the expected result?
To be honest, I'm not sure this is a bug or a specification.
The text was updated successfully, but these errors were encountered: