summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/reflect
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2014-02-28 12:03:09 -0800
committerSom Snytt <som.snytt@gmail.com>2014-02-28 12:13:33 -0800
commit953b776d49d7de55a74967f6a48beea763d22144 (patch)
tree7d2feb53e7a11fdc8c91bfdcaac3ff24bda899e1 /src/compiler/scala/tools/reflect
parentfabc9f1424824975943241b9bb2c9b7669f805bd (diff)
downloadscala-953b776d49d7de55a74967f6a48beea763d22144.tar.gz
scala-953b776d49d7de55a74967f6a48beea763d22144.tar.bz2
scala-953b776d49d7de55a74967f6a48beea763d22144.zip
SI-8266 Amend advice for deprecated octal 042
Improve the advice for `f"\042"` to read: ``` use ${'"'} or a triple-quoted literal """with embedded " or \u0022""" instead. ``` as per the discussion on SI-6476. Knuth says that Charles XII came close to introducing octal arithmetic to Sweden, and Wikipedia doesn't deny it. I imagine an alternative history in which octal literals are deprecated in Scala but required by legislation in Akka. #octal-fan-fiction
Diffstat (limited to 'src/compiler/scala/tools/reflect')
-rw-r--r--src/compiler/scala/tools/reflect/FormatInterpolator.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/reflect/FormatInterpolator.scala b/src/compiler/scala/tools/reflect/FormatInterpolator.scala
index 0258002850..e0f9bb6044 100644
--- a/src/compiler/scala/tools/reflect/FormatInterpolator.scala
+++ b/src/compiler/scala/tools/reflect/FormatInterpolator.scala
@@ -93,7 +93,8 @@ abstract class FormatInterpolator {
case '\n' => "\\n"
case '\f' => "\\f"
case '\r' => "\\r"
- case '\"' => "\\u0022" // $" in future
+ case '\"' => "${'\"'}" /* avoid lint warn */ +
+ " or a triple-quoted literal \"\"\"with embedded \" or \\u0022\"\"\"" // $" in future
case '\'' => "'"
case '\\' => """\\"""
case x => "\\u%04x" format x