<div dir="ltr">On Tue, 14 Mar 2017 at 19:50 Joe Groff <<a href="mailto:jgroff@apple.com">jgroff@apple.com</a>> wrote:<br><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><br></div><div>Will do! I'll file a bug that casting to <font face="monospace">`Any`</font> first causes different behavior.</div><div><br></div><div>Follow-up question, looking at the expression <font face="monospace">`name as! T`</font>, is it expected to cause a nil-unwrapping runtime error when <font face="monospace">`name == nil`</font> and <font face="monospace">`T == Optional<String>`</font>? Mind you, <font face="monospace">`(nil as! Optional<String>)`</font> does not cause an error.</div><div><br></div><div>If the nil-unwrapping error is expected, how can I write it so that it doesn't, and instead returns <font face="monospace">nil?</font></div><div><font face="monospace"><br></font></div></div></div>