You can use a plain text editor and no linter, or a plain text editor and a linter, or an IDE and no linter, etc., and in any of these scenarios you can already choose whether or not you want trailing newlines stripped. Why should the compiler try to enforce any rules here?<br><br><div>Since Unicode is supported, it is never possible to look at a string literal and be 100% sure of what glyphs are involved. We should be clear that such a criterion cannot and should not be a design goal. If it supports Unicode and is really literal, then confusables and invisibles will make it impossible to be sure of what you see; you would have to either stop supporting Unicode or stop being literal.<br><br>I&#39;m not sure this &quot;coding style&quot; you describe can properly be thought of as a multiline string literal. It sounds like what you want isn&#39;t multiline (in fact, you want a new way to write a very long single-line string) and it isn&#39;t literal (you want to use newlines in your code that do not represent a literal newline). If there is something extremely critical about a particular string, where you simply must start half of it on a separate line to help the readers of your code understand what you are doing, you can already do this by writing &quot;foo&quot; + [newline] &quot;bar&quot;. Or you could just let your editor soft-wrap your long string. Making your single-line string wrap the same way in every IDE just doesn&#39;t seem like it&#39;s related to or worth complicating the syntax for multiline string literals. I would be strongly opposed to such a feature.</div><div><br><br><div class="gmail_quote"><div>On Wed, Apr 19, 2017 at 23:42 Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@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 style="word-wrap:break-word"><div class="m_-6208984668242159980m_3629141258267239431bloop_markdown"><p>True, but this is not about IDEs or editors. The feature itself doesn’t know what an editor is and what it capable of, nor should be ever rely on that. Not everyone uses the same settings and you cannot be 100% sure to expect the same string from looking at it, which was written in a different editor if we don’t warn about trailing whitespaces now.</p>

<p>The trailing whitespaces might not do any harm for the currently accepted version, but we’ll have to warn about them if we decide to add the trailing backspace. As currently accepted we still have a hole to fill for coding styles, we do not support multi-lined string literals for code formatting only, nor do we have trailing precision for the same matter. (That’s what the backslash was meant for.) That said, I cannot break up a really long hardcoded string, which in my IDE is softly wrapped, into a multi-line string literal so that it looks in every editor the same and still expect the same result and be precise about the trailing whitespace characters.</p>

<p></p></div><div class="m_-6208984668242159980m_3629141258267239431bloop_original_html"></div></div><div style="word-wrap:break-word"><div class="m_-6208984668242159980m_3629141258267239431bloop_original_html"><div id="m_-6208984668242159980m_3629141258267239431bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div> <br> <div id="m_-6208984668242159980m_3629141258267239431bloop_sign_1492662767413933056" class="m_-6208984668242159980m_3629141258267239431bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div> <br></div></div><div style="word-wrap:break-word"><div class="m_-6208984668242159980m_3629141258267239431bloop_original_html"><p class="m_-6208984668242159980m_3629141258267239431airmail_on">Am 20. April 2017 um 00:27:48, Brent Royal-Gordon via swift-evolution (<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>) schrieb:</p> </div></div><div style="word-wrap:break-word"><div class="m_-6208984668242159980m_3629141258267239431bloop_original_html"><blockquote type="cite" class="m_-6208984668242159980m_3629141258267239431clean_bq"><span><div style="word-wrap:break-word"><div>






<div>
<blockquote type="cite">
<div>On Apr 19, 2017, at 3:18 PM, Xiaodi Wu via
swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div>
<br class="m_-6208984668242159980m_3629141258267239431Apple-interchange-newline">
<div>
<blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word">
<div>
<div>Other common tools like Git already flag trailing
whitespace by default, so even if Swift doesn&#39;t warn about it, you
might still need to satisfy other tools in your pipeline.</div>
</div>
</div>
</blockquote>
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div>
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Isn&#39;t that an equally good argument for Swift *not*
warning you about it? If it&#39;s harmful, you&#39;ll have other tools in
the pipeline to flag it for you.</div>
</div>
</blockquote>
</div>
<div><br></div>
<div>Cosigned. We already have an Xcode setting to strip
trailing whitespace, a Git setting to flag it, and linter settings
to remove it. (For instance, SwiftFormat has a --trimwhitespace
flag.) Not every tool needs to handle every case of questionable
style.</div>
<br>
<div>
<div>
<div style="font-size:12px"><span class="m_-6208984668242159980m_3629141258267239431Apple-style-span" style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
-- </span></div>
<div style="font-size:12px"><span class="m_-6208984668242159980m_3629141258267239431Apple-style-span" style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Brent Royal-Gordon</span></div>
<div style="font-size:12px"><span class="m_-6208984668242159980m_3629141258267239431Apple-style-span" style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Architechies</span></div>
</div>
</div>
<br></div></div></span></blockquote></div></div><div style="word-wrap:break-word"><div class="m_-6208984668242159980m_3629141258267239431bloop_original_html"><blockquote type="cite" class="m_-6208984668242159980m_3629141258267239431clean_bq"><span><div style="word-wrap:break-word"><div>


_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></div></span></blockquote></div></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div></div>