Last active
June 6, 2017 17:39
-
-
Save ainame/713822b896a320e8acd8ccac5f359cc0 to your computer and use it in GitHub Desktop.
Is this a bug on the Swift4?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let array: [String?] = ["a", "b", "c", "e"] | |
print(array) // => [Optional("a"), Optional("b"), Optional("c"), Optional("e")] | |
let strings = array.flatMap { $0! } | |
print(type(of: strings)) // => Array<Character> |
$ swift --version
Apple Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8)
Target: x86_64-apple-macosx10.9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
expected:
Array<String>