<div>Avoid using optionals in string interpolation or make it explicit as the fix-it suggests.</div><div><br><div class="gmail_quote"><div>On Wed, Apr 5, 2017 at 7:27 AM Maxim Veksler via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg">Hi,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Swift 3.1 compiler seems to introduces a new complier warning regarding String(describing: )</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So this line:</div><div class="gmail_msg"><p style="margin:0px;font-size:11px;line-height:normal;font-family:&#39;anonymous pro&#39;;color:rgb(180,38,26)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">Log</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">info</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">&quot;Update name for user </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg">\</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg">fbUser</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">)</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg">)</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:&#39;anonymous pro&#39;;color:rgb(180,38,26)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg"><br class="gmail_msg"></span></p>Produces the warning: &quot;note: use &#39;String(describing:)&#39; to silence this warning&quot;<p style="margin:0px;font-size:11px;line-height:normal;font-family:&#39;anonymous pro&#39;;color:rgb(180,38,26)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg"><br class="gmail_msg"></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:&#39;anonymous pro&#39;;color:rgb(180,38,26)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)" class="gmail_msg"></span></p>and becomes this line</div><div class="gmail_msg"><p style="margin:0px;font-size:11px;line-height:normal;font-family:&#39;anonymous pro&#39;" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">Log</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">info</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">&quot;Update name for user </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">\</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,149,175)" class="gmail_msg">String</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">(describing: fbUser)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,38,26)" class="gmail_msg">&quot;</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">)</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:&#39;anonymous pro&#39;;color:rgb(180,38,26)" class="gmail_msg"><br class="gmail_msg"></p>This new syntax is not very sexy, especially for logging. Any suggestions, possibility on the API end of Log to make this warning go away? or write it differently.<br class="gmail_msg"></div></div>
_______________________________________________<br class="gmail_msg">
swift-users mailing list<br class="gmail_msg">
<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="gmail_msg">
</blockquote></div></div>