From 03dc97975ea0f5fac43fea5e8b5b169c6c28375b Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Mon, 4 Sep 2023 16:33:55 +0200 Subject: [PATCH] Update Upcoming Potential Incompatibilities --- .../upcoming_incompatibilities.xml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/system/doc/general_info/upcoming_incompatibilities.xml b/system/doc/general_info/upcoming_incompatibilities.xml index 8538067b577d..1f34a31032dc 100644 --- a/system/doc/general_info/upcoming_incompatibilities.xml +++ b/system/doc/general_info/upcoming_incompatibilities.xml @@ -179,6 +179,75 @@ t.erl:6:18: Warning: type variable 'Unknown' is only used once (is unbound)

In OTP 27, that warning will become an error.

+
+ + Triple-Quoted Strings +

+ Before Erlang/OTP 27 a sequence of 3 or more double-quote characters + was grouped in pairs each meaning the empty string and if there was + an odd number the last character was the start of a string. + The empty strings were then concatenated and effectively disappeared. +

+

+ In Erlang/OTP 27; 3 or more double-quote characters + are interpreted as the start of a "Triple-Quoted String". See + EEP 64. +

+

+ Here follows some examples of code that would change meaning. + Note that all these examples before Erlang/OTP 27.0 was strange + since there was no sensible reason to write like that. +

+
+"""String Content"""
+%% Was interpreted as
+"" "String Content" ""
+%% Which becomes
+"String Content"
+%%
+%% In OTP 27 it is instead a syntax error since no text is allowed
+%% on the line after an opening triple-quote
+      
+
+"""
+String Content
+"""
+%% Was interpreted as
+"" "
+String Content
+" ""
+%% Which becomes
+"
+String Content
+"
+%%
+%% In OTP 27 it is instead interpreted as a
+%% Triple-Quoted String equivalent to
+"String Content"
+      
+
+""""
+++ foo() ++
+""""
+%% Became
+"" ++ foo() ++ ""
+%%
+%% In OTP 27 it is instead interpreted as a
+%% Triple-Quoted String (triple-or-more) equivalent to
+"++ foo() ++"
+      
+

+ From Erlang/OTP 26.1 up to 27.0 the compiler issues a warning for + a sequence of 3 or more double-quote characters + since that is almost certainly a mistake or + something like a result of bad automatic code generation. + If a users gets that warning, the code should be corrected + for example by inserting appropriate spaces between + the empty strings, or removing the redundant ones alltogether, + which will have the same meaning before and after Erlang/OTP 27. +

+
+