<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 15, 2017, at 4:47 AM, Kim Burgestrand <<a href="mailto:kim@burgestrand.se" class="">kim@burgestrand.se</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">On Tue, 14 Mar 2017 at 19:50 Joe Groff <<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>> wrote:<br class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
It shouldn't. Please file a bug, if you haven't already.<br class="gmail_msg"></blockquote><div class=""><br class=""></div><div class="">Will do! I'll file a bug that casting to <font face="monospace" class="">`Any`</font> first causes different behavior.</div><div class=""><br class=""></div><div class="">Follow-up question, looking at the expression <font face="monospace" class="">`name as! T`</font>, is it expected to cause a nil-unwrapping runtime error when <font face="monospace" class="">`name == nil`</font> and <font face="monospace" class="">`T == Optional<String>`</font>? Mind you, <font face="monospace" class="">`(nil as! Optional<String>)`</font> does not cause an error.</div></div></div></div></blockquote><br class=""></div><div>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.</div><div><br class=""></div><div>-Joe</div><br class=""></body></html>