<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></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 Jun 16, 2016, at 12:44 PM, Charlie Monroe via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> 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="">Sorry, didn't have time to actually submit the proposal, but it at least gave me some time to think it through a few more times.<div class=""><br class=""></div><div class="">After reconsiderations, I suggest the following:</div><div class=""><br class=""></div><div class="">- deprecation of interpolation of optionals.</div><div class="">- extending the Optional type by:</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>- <b class="">var detailedDescription: String</b> - which will return the same value as until now: "nil" for nil and "Optional(value)" for .some(_). This is due to .description and .debugDescription's documentation discouraging direct invocation.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>- <b class="">func descriptionWithDefaultValue(_ defaultValue: String = "nil") -> String</b> - which would return either the description of the value, or `defaultValue`.</div><div class=""><br class=""></div><div class="">So, when the compiler runs into interpolation of an Optional, it issues a warning with a fix-it, that by default calls .descriptionWithDefaultValue() on the optional.</div></div></div></blockquote><br class=""></div><div>I think that this is overcomplicating the issue. I’d suggest that someone just implement a simple compiler patch (which doesn’t need an evolution proposal):</div><div><br class=""></div><div>1. Produce a warning when a string interpolation includes a non-redundantly-parenthesized optional, saying that this is probably a bug.</div><div>2. Attach two notes (with fixits) to the warning:</div><div>2a. a note that adds redundant parens around the parameter, silencing the warning.</div><div>2b. a note that fixits the issue with a “!” or "?? <#placeholder#>"</div><div><br class=""></div><div>I agree that this should be fixed.</div><div><br class=""></div><div>-Chris</div><br class=""></body></html>