Skip to content

Commit 7618778

Browse files
committed
Make -explain-types a -Y option as -Yexplain-types.
It prints compiler implementation details about constraint solving.
1 parent ff3637f commit 7618778

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
7777
val semanticdbTarget: Setting[String] = PathSetting("-semanticdb-target", "Specify an alternative output directory for SemanticDB files.", "")
7878

7979
val deprecation: Setting[Boolean] = BooleanSetting("-deprecation", "Emit warning and location for usages of deprecated APIs.") withAbbreviation "--deprecation"
80-
val explainTypes: Setting[Boolean] = BooleanSetting("-explain-types", "Explain type errors in more detail.") withAbbreviation "--explain-types"
8180
val explain: Setting[Boolean] = BooleanSetting("-explain", "Explain errors in more detail.") withAbbreviation "--explain"
8281
val feature: Setting[Boolean] = BooleanSetting("-feature", "Emit warning and location for usages of features that should be imported explicitly.") withAbbreviation "--feature"
8382
val help: Setting[Boolean] = BooleanSetting("-help", "Print a synopsis of standard options.") withAbbreviation "--help"
@@ -204,6 +203,7 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
204203

205204
/** Area-specific debug output */
206205
val YexplainLowlevel: Setting[Boolean] = BooleanSetting("-Yexplain-lowlevel", "When explaining type errors, show types at a lower level.")
206+
val YexplainTypes: Setting[Boolean] = BooleanSetting("-Yexplain-types", "Explain type errors in more detail.")
207207
val YnoDoubleBindings: Setting[Boolean] = BooleanSetting("-Yno-double-bindings", "Assert no namedtype is bound twice (should be enabled only if program is error-free).")
208208
val YshowVarBounds: Setting[Boolean] = BooleanSetting("-Yshow-var-bounds", "Print type variables with their bounds.")
209209

compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ object ErrorReporting {
123123
if ((found1 eq found) != (expected eq expected1) && (found1 <:< expected1))
124124
i"""
125125
|(Note that Scala's and Java's representation of this type differs)"""
126-
else if (ctx.settings.explainTypes.value)
126+
else if (ctx.settings.YexplainTypes.value)
127127
i"""
128128
|${ctx.typerState.constraint}
129129
|${TypeComparer.explained(_.isSubType(found, expected))}"""

0 commit comments

Comments
 (0)