Avatar
swiftbot BOT 5/16/2018 2:59 AM
Author icon
t.ae
import Foundation print(TimeZone(abbreviation: "JST"))
Version:
swift-4.1.1-RELEASE
Output:
Optional(Asia/Tokyo (fixed))
Error:
/usercode/main.swift:2:7: warning: expression implicitly coerced from 'TimeZone?' to Any print(TimeZone(abbreviation: "JST")) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usercode/main.swift:2:7: note: provide a default value to avoid this warning print(TimeZone(abbreviation: "JST")) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ?? <#default value#> /usercode/main.swift:2:7: note: force-unwrap the value to avoid this warning print(TimeZone(abbreviation: "JST")) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! /usercode/main.swift:2:7: note: explicitly cast to Any with 'as Any' to silence this warning print(TimeZone(abbreviation: "JST")) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ as Any