Skip to content

Commit 53df4a3

Browse files
committed
-Wall of shame
1 parent 8d522f1 commit 53df4a3

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ private sealed trait WarningSettings:
309309
def enumCommentDiscard(using Context): Boolean = allOr(WenumCommentDiscard)
310310
def implausiblePatterns(using Context): Boolean = allOr(WimplausiblePatterns)
311311
def unstableInlineAccessors(using Context): Boolean = allOr(WunstableInlineAccessors)
312+
def toStringInterpolated(using Context): Boolean = allOr(WtoStringInterpolated)
312313
def checkInit(using Context): Boolean = allOr(WcheckInit)
313314

314315
/** -X "Extended" or "Advanced" settings */

compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class TypedFormatChecker(partsElems: List[Tree], parts: List[String], args: List
221221
case _ => true
222222

223223
def lintToString(arg: Type): Unit =
224-
if ctx.settings.WtoStringInterpolated.value && kind == StringXn && !(arg.widen =:= defn.StringType) && !arg.isPrimitiveValueType
224+
if ctx.settings.Whas.toStringInterpolated && kind == StringXn && !(arg.widen =:= defn.StringType) && !arg.isPrimitiveValueType
225225
then warningAt(CC)("interpolation uses toString")
226226

227227
// what arg type if any does the conversion accept

compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class StringInterpolatorOpt extends MiniPhase:
110110
end mkConcat
111111
def lintToString(t: Tree): Unit =
112112
val arg: Type = t.tpe
113-
if ctx.settings.WtoStringInterpolated.value && !(arg.widen =:= defn.StringType) && !arg.isPrimitiveValueType
113+
if ctx.settings.Whas.toStringInterpolated && !(arg.widen =:= defn.StringType) && !arg.isPrimitiveValueType
114114
then report.warning("interpolation uses toString", t.srcPos)
115115
val sym = tree.symbol
116116
// Test names first to avoid loading scala.StringContext if not used, and common names first

0 commit comments

Comments
 (0)