summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/reflect/FormatInterpolator.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-09-15 23:16:40 -0700
committerSom Snytt <som.snytt@gmail.com>2017-03-11 23:38:08 -0800
commit94b938bb290a231694e5721368023bd6693bb2ed (patch)
treece8366bfa9b301add12d53f2ddf13fe7e05b235a /src/compiler/scala/tools/reflect/FormatInterpolator.scala
parentbd280077d04a3ac84ca48f549faaa8915d46ef2e (diff)
downloadscala-94b938bb290a231694e5721368023bd6693bb2ed.tar.gz
scala-94b938bb290a231694e5721368023bd6693bb2ed.tar.bz2
scala-94b938bb290a231694e5721368023bd6693bb2ed.zip
SI-8040 Warn unused flags
Introduce `-Ywarn-unused:x,y,z` and exploit `-Ywarn-unused:patvars`. Although the tree attachment for shielding patvars from warnings is not structural, sneaking the settings flag into the reflection internal TreeGen is awkward. Add test to ensure isolation of patvars warning from others. `-Ywarn-unused-import` is an alias for `-Ywarn-unused:imports`. `-Xlint:unused` is an alias for `-Ywarn-unused`, but not enabled yet. The help text advises to use `-Ywarn-unused`. The future can decide if `-Xlint:unused-imports` is warranted.
Diffstat (limited to 'src/compiler/scala/tools/reflect/FormatInterpolator.scala')
-rw-r--r--src/compiler/scala/tools/reflect/FormatInterpolator.scala3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/reflect/FormatInterpolator.scala b/src/compiler/scala/tools/reflect/FormatInterpolator.scala
index bbb2987679..857b733f59 100644
--- a/src/compiler/scala/tools/reflect/FormatInterpolator.scala
+++ b/src/compiler/scala/tools/reflect/FormatInterpolator.scala
@@ -19,7 +19,6 @@ abstract class FormatInterpolator {
@inline private def truly(body: => Unit): Boolean = { body ; true }
@inline private def falsely(body: => Unit): Boolean = { body ; false }
- //private def fail(msg: String) = c.abort(c.enclosingPosition, msg)
private def bail(msg: String) = global.abort(msg)
def interpolate: Tree = c.macroApplication match {
@@ -94,7 +93,7 @@ abstract class FormatInterpolator {
case '\f' => "\\f"
case '\r' => "\\r"
case '\"' => "$" /* avoid lint warn */ +
- "{'\"'} or a triple-quoted literal \"\"\"with embedded \" or \\u0022\"\"\"" // $" in future?
+ "{'\"'} or a triple-quoted literal \"\"\"with embedded \" or \\u0022\"\"\""
case '\'' => "'"
case '\\' => """\\"""
case x => "\\u%04x" format x