> On Mar 15, 2017, at 4:47 AM, Kim Burgestrand <k...@burgestrand.se> wrote: > > On Tue, 14 Mar 2017 at 19:50 Joe Groff <jgr...@apple.com > <mailto:jgr...@apple.com>> wrote: > > It shouldn't. Please file a bug, if you haven't already. > > Will do! I'll file a bug that casting to `Any` first causes different > behavior. > > Follow-up question, looking at the expression `name as! T`, is it expected to > cause a nil-unwrapping runtime error when `name == nil` and `T == > Optional<String>`? Mind you, `(nil as! Optional<String>)` does not cause an > error.
If you're casting to an Optional destination type, then the cast ought to succeed and produce a `nil` result if the input is nil. -Joe
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users