Skip to content

Commit 97ca3aa

Browse files
committed
Put all debug/developer behind an AlmostFinalValue false
1 parent 089bad7 commit 97ca3aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+104
-93
lines changed

src/compiler/scala/tools/nsc/CompilerCommand.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
113113
else if (Yhelp) yusageMsg
114114
else if (showPlugins) global.pluginDescriptions
115115
else if (showPhases) global.phaseDescriptions + (
116-
if (debug) "\n" + global.phaseFlagDescriptions else ""
116+
if (settings.isDebug) "\n" + global.phaseFlagDescriptions else ""
117117
)
118118
else if (genPhaseGraph.isSetByUser) {
119119
val components = global.phaseNames // global.phaseDescriptors // one initializes

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
282282
// ------------------ Debugging -------------------------------------
283283

284284
@inline final def ifDebug(body: => Unit): Unit = {
285-
if (settings.debug)
285+
if (settings.isDebug)
286286
body
287287
}
288288

@@ -313,7 +313,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
313313
}
314314

315315
@inline final override def debuglog(msg: => String): Unit = {
316-
if (settings.debug)
316+
if (settings.isDebug)
317317
log(msg)
318318
}
319319

@@ -417,7 +417,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
417417
if ((unit ne null) && unit.exists)
418418
lastSeenSourceFile = unit.source
419419

420-
if (settings.debug && (settings.verbose || currentRun.size < 5))
420+
if (settings.isDebug && (settings.verbose || currentRun.size < 5))
421421
inform("[running phase " + name + " on " + unit + "]")
422422
}
423423

@@ -713,7 +713,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
713713
protected def computePhaseDescriptors: List[SubComponent] = {
714714
/* Allow phases to opt out of the phase assembly. */
715715
def cullPhases(phases: List[SubComponent]) = {
716-
val enabled = if (settings.debug && settings.isInfo) phases else phases filter (_.enabled)
716+
val enabled = if (settings.isDebug && settings.isInfo) phases else phases filter (_.enabled)
717717
def isEnabled(q: String) = enabled exists (_.phaseName == q)
718718
val (satisfied, unhappy) = enabled partition (_.requires forall isEnabled)
719719
unhappy foreach (u => globalError(s"Phase '${u.phaseName}' requires: ${u.requires filterNot isEnabled}"))
@@ -744,7 +744,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
744744
}
745745

746746
/** A description of the phases that will run in this configuration, or all if -Vdebug. */
747-
def phaseDescriptions: String = phaseHelp("description", elliptically = !settings.debug, phasesDescMap)
747+
def phaseDescriptions: String = phaseHelp("description", elliptically = !settings.isDebug, phasesDescMap)
748748

749749
/** Summary of the per-phase values of nextFlags and newFlags, shown under -Vphases -Vdebug. */
750750
def phaseFlagDescriptions: String = {
@@ -755,7 +755,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
755755
else if (ph.phaseNewFlags != 0L && ph.phaseNextFlags != 0L) fstr1 + " " + fstr2
756756
else fstr1 + fstr2
757757
}
758-
phaseHelp("new flags", elliptically = !settings.debug, fmt)
758+
phaseHelp("new flags", elliptically = !settings.isDebug, fmt)
759759
}
760760

761761
/** Emit a verbose phase table.
@@ -1113,7 +1113,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
11131113

11141114
def echoPhaseSummary(ph: Phase) = {
11151115
/* Only output a summary message under debug if we aren't echoing each file. */
1116-
if (settings.debug && !(settings.verbose || currentRun.size < 5))
1116+
if (settings.isDebug && !(settings.verbose || currentRun.size < 5))
11171117
inform("[running phase " + ph.name + " on " + currentRun.size + " compilation units]")
11181118
}
11191119

src/compiler/scala/tools/nsc/MainTokenMetric.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object MainTokenMetric {
5050
tokenMetric(compiler, command.files)
5151
} catch {
5252
case ex @ FatalError(msg) =>
53-
if (command.settings.debug)
53+
if (command.settings.isDebug)
5454
ex.printStackTrace()
5555
reporter.error(null, "fatal error: " + msg)
5656
}

src/compiler/scala/tools/nsc/ast/Positions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ trait Positions extends scala.reflect.internal.Positions {
3939
}
4040

4141
override protected[this] lazy val posAssigner: PosAssigner =
42-
if (settings.Yrangepos && settings.debug || settings.Yposdebug) new ValidatingPosAssigner
42+
if (settings.Yrangepos && settings.isDebug || settings.Yposdebug) new ValidatingPosAssigner
4343
else new DefaultPosAssigner
4444
}

src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ abstract class BCodeSkelBuilder extends BCodeHelpers {
644644
case Return(_) | Block(_, Return(_)) | Throw(_) | Block(_, Throw(_)) => ()
645645
case EmptyTree =>
646646
globalError("Concrete method has no definition: " + dd + (
647-
if (settings.debug) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
647+
if (settings.isDebug) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
648648
else ""))
649649
case _ =>
650650
bc emitRETURN returnType

src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ abstract class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
9292
assert(classSym != NoSymbol, "Cannot create ClassBType from NoSymbol")
9393
assert(classSym.isClass, s"Cannot create ClassBType from non-class symbol $classSym")
9494
// note: classSym can be scala.Array, see https://github.com/scala/bug/issues/12225#issuecomment-729687859
95-
if (global.settings.debug) {
95+
if (global.settings.isDebug) {
9696
// OPT this assertion has too much performance overhead to run unconditionally
9797
assert(!primitiveTypeToBType.contains(classSym) || isCompilingPrimitive, s"Cannot create ClassBType for primitive class symbol $classSym")
9898
}

src/compiler/scala/tools/nsc/backend/jvm/CodeGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class CodeGen[G <: Global](val global: G) extends PerRunInit {
5050
} catch {
5151
case ex: InterruptedException => throw ex
5252
case ex: Throwable =>
53-
if (settings.debug) ex.printStackTrace()
53+
if (settings.isDebug) ex.printStackTrace()
5454
globalError(s"Error while emitting ${unit.source}\n${ex.getMessage}")
5555
}
5656

src/compiler/scala/tools/nsc/backend/jvm/PostProcessorFrontendAccess.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ object PostProcessorFrontendAccess {
184184
private def buildCompilerSettings(): CompilerSettings = new CompilerSettings {
185185
import global.{settings => s}
186186

187-
val debug: Boolean = s.debug
187+
@inline def debug: Boolean = s.isDebug
188188

189189
val target: String = s.target.value
190190

src/compiler/scala/tools/nsc/plugins/Plugins.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ trait Plugins { global: Global =>
150150
} globalError("bad option: -P:" + opt)
151151

152152
// Plugins may opt out, unless we just want to show info
153-
plugs filter (p => p.init(p.options, globalError) || (settings.debug && settings.isInfo))
153+
plugs filter (p => p.init(p.options, globalError) || (settings.isDebug && settings.isInfo))
154154
}
155155

156156
lazy val plugins: List[Plugin] = loadPlugins()

src/compiler/scala/tools/nsc/reporters/Reporter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ abstract class FilteringReporter extends Reporter {
119119
// Invoked when an error or warning is filtered by position.
120120
@inline def suppress = {
121121
if (settings.prompt) doReport(pos, msg, severity)
122-
else if (settings.debug) doReport(pos, s"[ suppressed ] $msg", severity)
122+
else if (settings.isDebug) doReport(pos, s"[ suppressed ] $msg", severity)
123123
Suppress
124124
}
125125
if (!duplicateOk(pos, severity, msg)) suppress else if (!maxOk) Count else Display

src/compiler/scala/tools/nsc/settings/ScalaSettings.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ trait ScalaSettings extends StandardScalaSettings with Warnings { _: MutableSett
9898
val Xhelp = BooleanSetting ("-X", "Print a synopsis of advanced options.")
9999
val async = BooleanSetting ("-Xasync", "Enable the async phase for scala.async.Async.{async,await}.")
100100
val checkInit = BooleanSetting ("-Xcheckinit", "Wrap field accessors to throw an exception on uninitialized access.")
101-
val developer = BooleanSetting ("-Xdev", "Issue warnings about anything which seems amiss in compiler internals. Intended for compiler developers")
101+
val developer = BooleanSetting ("-Xdev", "Issue warnings about anything which seems amiss in compiler internals. Intended for compiler developers").withPostSetHook(s => if (s.value) StatisticsStatics.enableDeveloperAndDeoptimize())
102102
val noassertions = BooleanSetting ("-Xdisable-assertions", "Generate no assertions or assumptions.") andThen (flag =>
103103
if (flag) elidebelow.value = elidable.ASSERTION + 1)
104104
val elidebelow = IntSetting ("-Xelide-below", "Calls to @elidable methods are omitted if method priority is lower than argument",
@@ -453,7 +453,7 @@ trait ScalaSettings extends StandardScalaSettings with Warnings { _: MutableSett
453453
*/
454454
val Vhelp = BooleanSetting("-V", "Print a synopsis of verbose options.")
455455
val browse = PhasesSetting("-Vbrowse", "Browse the abstract syntax tree after") withAbbreviation "-Ybrowse"
456-
val debug = BooleanSetting("-Vdebug", "Increase the quantity of debugging output.") withAbbreviation "-Ydebug"
456+
val debug = BooleanSetting("-Vdebug", "Increase the quantity of debugging output.") withAbbreviation "-Ydebug" withPostSetHook (s => if (s.value) StatisticsStatics.enableDebugAndDeoptimize())
457457
val YdebugTasty = BooleanSetting("-Vdebug-tasty", "Increase the quantity of debugging output when unpickling tasty.") withAbbreviation "-Ydebug-tasty"
458458
val Ydocdebug = BooleanSetting("-Vdoc", "Trace scaladoc activity.") withAbbreviation "-Ydoc-debug"
459459
val Yidedebug = BooleanSetting("-Vide", "Generate, validate and output trees using the interactive compiler.") withAbbreviation "-Yide-debug"

src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ abstract class SymbolLoaders {
5757
}
5858

5959
protected def signalError(root: Symbol, ex: Throwable): Unit = {
60-
if (settings.debug) ex.printStackTrace()
60+
if (settings.isDebug) ex.printStackTrace()
6161
globalError(ex.getMessage() match {
6262
case null => "i/o error while loading " + root.name
6363
case msg => "error while loading " + root.name + ", " + msg

src/compiler/scala/tools/nsc/symtab/SymbolTrackers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ trait SymbolTrackers {
133133
else " (" + Flags.flagsToString(masked) + ")"
134134
}
135135
def symString(sym: Symbol) = (
136-
if (settings.debug && sym.hasCompleteInfo) {
136+
if (settings.isDebug && sym.hasCompleteInfo) {
137137
val s = sym.defString take 240
138138
if (s.length == 240) s + "..." else s
139139
}

src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ abstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
117117
}
118118

119119
private def handleMissing(e: MissingRequirementError) = {
120-
if (settings.debug) e.printStackTrace
120+
if (settings.isDebug) e.printStackTrace
121121
throw new IOException(s"Missing dependency '${e.req}', required by $file")
122122
}
123123
private def handleError(e: Exception) = {
124-
if (settings.debug) e.printStackTrace()
124+
if (settings.isDebug) e.printStackTrace()
125125
throw new IOException(s"class file '$file' is broken\n(${e.getClass}/${e.getMessage})")
126126
}
127127
private def mismatchError(c: Symbol) = {
@@ -420,7 +420,8 @@ abstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
420420
// - better owner than `NoSymbol`
421421
// - remove eager warning
422422
val msg = s"Class $name not found - continuing with a stub."
423-
if ((!settings.isScaladoc) && (settings.verbose || settings.developer)) loaders.warning(NoPosition, msg, WarningCategory.OtherDebug, clazz.fullNameString)
423+
if ((!settings.isScaladoc) && (settings.verbose || settings.isDeveloper))
424+
loaders.warning(NoPosition, msg, WarningCategory.OtherDebug, clazz.fullNameString)
424425
NoSymbol.newStubSymbol(name.toTypeName, msg)
425426
}
426427

@@ -471,7 +472,7 @@ abstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
471472
case ex: FatalError =>
472473
// getClassByName can throw a MissingRequirementError (which extends FatalError)
473474
// definitions.getMember can throw a FatalError, for example in pos/t5165b
474-
if (settings.debug)
475+
if (settings.isDebug)
475476
ex.printStackTrace()
476477
stubClassSymbol(newTypeName(name))
477478
}
@@ -1007,7 +1008,7 @@ abstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
10071008
// with a `FatalError` exception, handled above. Here you'd end up after a NPE (for example),
10081009
// and that should never be swallowed silently.
10091010
loaders.warning(NoPosition, s"Caught: $ex while parsing annotations in ${file}", WarningCategory.Other, clazz.fullNameString)
1010-
if (settings.debug) ex.printStackTrace()
1011+
if (settings.isDebug) ex.printStackTrace()
10111012
None // ignore malformed annotations
10121013
}
10131014

src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ abstract class Pickler extends SubComponent {
112112
//
113113
// OPT: do this only as a recovery after fatal error. Checking in advance was expensive.
114114
if (t.isErroneous) {
115-
if (settings.debug) e.printStackTrace()
115+
if (settings.isDebug) e.printStackTrace()
116116
reporter.error(t.pos, "erroneous or inaccessible type")
117117
return
118118
}

src/compiler/scala/tools/nsc/tasty/bridge/ContextOps.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ trait ContextOps { self: TastyUniverse =>
144144
final def globallyVisibleOwner: Symbol = owner.logicallyEnclosingMember
145145

146146
final def ignoreAnnotations: Boolean = u.settings.YtastyNoAnnotations
147-
final def verboseDebug: Boolean = u.settings.debug
148147

149148
def requiresLatentEntry(decl: Symbol): Boolean = decl.isScala3Inline
150149
def neverEntered(decl: Symbol): Boolean = decl.isPureMixinCtor

src/compiler/scala/tools/nsc/transform/CleanUp.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ abstract class CleanUp extends Statics with Transform with ast.TreeDSL {
369369

370370
/* For testing purposes, the dynamic application's condition
371371
* can be printed-out in great detail. Remove? */
372-
if (settings.debug) {
372+
if (settings.isDebug) {
373373
def paramsToString(xs: Any*) = xs map (_.toString) mkString ", "
374374
val mstr = ad.symbol.tpe match {
375375
case MethodType(mparams, resType) =>

src/compiler/scala/tools/nsc/transform/Erasure.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ abstract class Erasure extends InfoTransform
9494
if (! ts.isEmpty && ! result) { apply(ts.head) ; untilApply(ts.tail) }
9595
}
9696

97-
override protected def verifyJavaErasure = settings.Xverify || settings.debug
97+
override protected def verifyJavaErasure = settings.Xverify || settings.isDebug
9898
private def needsJavaSig(sym: Symbol, tp: Type, throwsArgs: List[Type]) = !settings.Ynogenericsig && {
9999
def needs(tp: Type) = NeedsSigCollector(sym.isClassConstructor).collect(tp)
100100
needs(tp) || throwsArgs.exists(needs)
@@ -518,7 +518,7 @@ abstract class Erasure extends InfoTransform
518518
clashErrors += Tuple2(pos, msg)
519519
}
520520
for (bc <- root.baseClasses) {
521-
if (settings.debug)
521+
if (settings.isDebug)
522522
exitingPostErasure(println(
523523
sm"""check bridge overrides in $bc
524524
|${bc.info.nonPrivateDecl(bridge.name)}

src/compiler/scala/tools/nsc/transform/TypeAdaptingTransformer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ trait TypeAdaptingTransformer { self: TreeDSL =>
9797
case ArrayClass => assert(pt.typeSymbol != ArrayClass, "array") ; tree
9898
case _ =>
9999
val unboxer = currentRun.runDefinitions.unboxMethod(pt.typeSymbol)
100-
if (settings.developer) assert(boxedClass(pt.typeSymbol).tpe <:< tree.tpe, s"${tree.tpe} is not a boxed ${pt}")
100+
if (settings.isDeveloper) assert(boxedClass(pt.typeSymbol).tpe <:< tree.tpe, s"${tree.tpe} is not a boxed ${pt}")
101101
Apply(unboxer, tree) // don't `setType pt` the Apply tree, as the Apply's fun won't be typechecked if the Apply tree already has a type
102102
}
103103
}
@@ -116,7 +116,7 @@ trait TypeAdaptingTransformer { self: TreeDSL =>
116116
* @note Pre-condition: pt eq pt.normalize
117117
*/
118118
final def cast(tree: Tree, pt: Type): Tree = {
119-
if (settings.debug && (tree.tpe ne null) && !(tree.tpe =:= ObjectTpe)) {
119+
if (settings.isDebug && (tree.tpe ne null) && !(tree.tpe =:= ObjectTpe)) {
120120
def word =
121121
if (tree.tpe <:< pt) "upcast"
122122
else if (pt <:< tree.tpe) "downcast"

src/compiler/scala/tools/nsc/transform/async/AsyncPhase.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ abstract class AsyncPhase extends Transform with TypingTransformers with AnfTran
178178
val applyBody = atPos(asyncPos)(asyncBlock.onCompleteHandler)
179179

180180
// Logging
181-
if ((settings.debug.value && shouldLogAtThisPhase))
181+
if ((settings.isDebug && shouldLogAtThisPhase))
182182
logDiagnostics(anfTree, asyncBlock, asyncBlock.asyncStates.map(_.toString))
183183
// Offer async frontends a change to produce the .dot diagram
184184
transformState.dotDiagram(applySym, asyncBody).foreach(f => f(asyncBlock.toDot))

src/compiler/scala/tools/nsc/typechecker/Implicits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ trait Implicits extends splain.SplainData {
15251525
if (args contains EmptyTree) EmptyTree
15261526
else typedPos(tree.pos.focus) {
15271527
val mani = gen.mkManifestFactoryCall(full, constructor, tparg, args.toList)
1528-
if (settings.debug) println("generated manifest: "+mani) // DEBUG
1528+
if (settings.isDebug) println("generated manifest: "+mani) // DEBUG
15291529
mani
15301530
}
15311531

@@ -1762,7 +1762,7 @@ trait Implicits extends splain.SplainData {
17621762
}
17631763
}
17641764

1765-
if (result.isFailure && settings.debug) // debuglog is not inlined for some reason
1765+
if (result.isFailure && settings.isDebug) // debuglog is not inlined for some reason
17661766
log(s"no implicits found for ${pt} ${pt.typeSymbol.info.baseClasses} ${implicitsOfExpectedType}")
17671767

17681768
result

src/compiler/scala/tools/nsc/typechecker/Infer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ trait Infer extends Checkable {
239239

240240
// When filtering sym down to the accessible alternatives leaves us empty handed.
241241
private def checkAccessibleError(tree: Tree, sym: Symbol, pre: Type, site: Tree): Tree = {
242-
if (settings.debug) {
242+
if (settings.isDebug) {
243243
Console.println(context)
244244
Console.println(tree)
245245
Console.println("" + pre + " " + sym.owner + " " + context.owner + " " + context.outer.enclClass.owner + " " + sym.owner.thisType + (pre =:= sym.owner.thisType))

src/compiler/scala/tools/nsc/typechecker/RefChecks.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ abstract class RefChecks extends Transform {
148148
}
149149

150150
// This has become noisy with implicit classes.
151-
if (settings.warnPolyImplicitOverload && settings.developer) {
151+
if (settings.isDeveloper && settings.warnPolyImplicitOverload) {
152152
clazz.info.decls.foreach(sym => if (sym.isImplicit && sym.typeParams.nonEmpty) {
153153
// implicit classes leave both a module symbol and a method symbol as residue
154154
val alts = clazz.info.decl(sym.name).alternatives filterNot (_.isModule)
@@ -303,7 +303,7 @@ abstract class RefChecks extends Transform {
303303
def isNeitherInClass = memberClass != clazz && otherClass != clazz
304304

305305
val indent = " "
306-
def overriddenWithAddendum(msg: String, foundReq: Boolean = settings.debug.value): String = {
306+
def overriddenWithAddendum(msg: String, foundReq: Boolean = settings.isDebug): String = {
307307
val isConcreteOverAbstract =
308308
(otherClass isSubClass memberClass) && other.isDeferred && !member.isDeferred
309309
val addendum =
@@ -1868,7 +1868,7 @@ abstract class RefChecks extends Transform {
18681868
result1
18691869
} catch {
18701870
case ex: TypeError =>
1871-
if (settings.debug) ex.printStackTrace()
1871+
if (settings.isDebug) ex.printStackTrace()
18721872
reporter.error(tree.pos, ex.getMessage())
18731873
tree
18741874
} finally {

src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ abstract class TreeCheckers extends Analyzer {
130130
// new symbols
131131
if (newSyms.nonEmpty) {
132132
informFn("" + newSyms.size + " new symbols.")
133-
val toPrint = if (settings.debug) sortedNewSyms mkString " " else ""
133+
val toPrint = if (settings.isDebug) sortedNewSyms mkString " " else ""
134134

135135
newSyms.clear()
136136
if (toPrint != "")
@@ -177,7 +177,7 @@ abstract class TreeCheckers extends Analyzer {
177177
def errorFn(msg: Any): Unit = errorFn(NoPosition, msg)
178178

179179
def informFn(msg: Any): Unit = {
180-
if (settings.verbose || settings.debug)
180+
if (settings.verbose || settings.isDebug)
181181
println("[check: %s] %s".format(phase.prev, msg))
182182
}
183183

src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ trait TypeDiagnostics extends splain.SplainDiagnostics {
820820
// but it seems that throwErrors excludes some of the errors that should actually be
821821
// buffered, causing TypeErrors to fly around again. This needs some more investigation.
822822
if (!context0.reportErrors) throw ex
823-
if (settings.debug) ex.printStackTrace()
823+
if (settings.isDebug) ex.printStackTrace()
824824

825825
ex match {
826826
case CyclicReference(sym, info: TypeCompleter) =>

0 commit comments

Comments
 (0)