<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">That does seem like a bug, but one possibility is that 'result' has type 'AnyObject', and so you're getting an extra level of optional due to the subscript operator possibly not being there. Do you have a full, self-contained test case?</div><div class=""><br class=""></div><div class="">Jordan</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 22, 2016, at 15:17 , Valentin Radu via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello all,<div class=""><br class=""></div><div class=""><br class=""></div><div class="">I have a question re the nil coalescing operator. Shouldn’t&nbsp;</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(165, 191, 142);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bf626b" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #c0c5cf" class=""> (</span>"This machine's ip is <span style="font-variant-ligatures: no-common-ligatures; color: #c0c5cf" class="">\</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #c0c5cf" class="">result</span><span style="font-variant-ligatures: no-common-ligatures; color: #c0c5cf" class="">[</span>"ip"<span style="font-variant-ligatures: no-common-ligatures; color: #c0c5cf" class="">] ?? </span>“unknown")”<span style="font-variant-ligatures: no-common-ligatures; color: #c0c5cf" class="">)&nbsp;</span></div></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(165, 191, 142);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #c0c5cf" class=""><br class=""></span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(165, 191, 142);" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">return&nbsp;</span><b style="color: rgb(99, 114, 125); font-size: 11px;" class="">This machine's ip is 78.97.202.31&nbsp;</b><span style="font-family: Helvetica; font-size: 12px;" class="">? Since the value is always String, not String?. &nbsp;However, it still surrounds the ip with Optional().&nbsp;</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(165, 191, 142);" class=""><span style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class="">So I’m using,&nbsp;<span style="color: rgb(192, 197, 207); font-family: Menlo; font-size: 14px;" class="">(result.</span><span style="font-family: Menlo; font-size: 14px; color: rgb(209, 135, 113);" class="">0</span><span style="color: rgb(192, 197, 207); font-family: Menlo; font-size: 14px;" class="">[</span><span style="font-family: Menlo; font-size: 14px; color: rgb(165, 191, 142);" class="">"ip"</span><span style="color: rgb(192, 197, 207); font-family: Menlo; font-size: 14px;" class="">] ?? </span><span style="font-family: Menlo; font-size: 14px; color: rgb(165, 191, 142);" class="">"nil"</span><span style="color: rgb(192, 197, 207); font-family: Menlo; font-size: 14px;" class="">).description&nbsp;</span>but is long and dirty. Any thoughts?&nbsp;</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">Cheers!</div><div style="margin: 0px; line-height: normal;" class="">– V</div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>