diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 6ef33d24f8be..6a8a88a429e5 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -353,8 +353,7 @@ private sealed trait XSettings: val XreadComments: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xread-docs", "Read documentation from tasty.") /** Area-specific debug output */ - val XnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.") - val XnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.") + val XnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.", aliases = List("Xno-decode-stacktraces")) val XdebugMacros: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xdebug-macros", "Show debug info when quote pattern match fails") /** Pipeline compilation options */ @@ -487,7 +486,7 @@ private sealed trait YSettings: @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YreadComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Yread-docs", "Read documentation from tasty.", deprecation = Deprecation.renamed("-Xread-docs")) @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") - val YnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.", deprecation = Deprecation.renamed("-Xno-decode-stacktraces")) + val YnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.", deprecation = Deprecation.renamed("-Xno-enrich-error-messages")) @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.", deprecation = Deprecation.renamed("-Xno-enrich-error-messages")) @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") diff --git a/compiler/src/dotty/tools/dotc/core/TypeErrors.scala b/compiler/src/dotty/tools/dotc/core/TypeErrors.scala index 1c9696da67d1..4761beae8bd0 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeErrors.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeErrors.scala @@ -117,7 +117,7 @@ extends TypeError: em"""Recursion limit exceeded. |Maybe there is an illegal cyclic reference? |If that's not the case, you could also try to increase the stacksize using the -Xss JVM option. - |For the unprocessed stack trace, compile with -Xno-decode-stacktraces. + |For the unprocessed stack trace, compile with -Xno-enrich-error-messages. |A recurring operation is (inner to outer): |${opsString(mostCommon).stripMargin}""" @@ -137,7 +137,7 @@ object handleRecursive: e def apply(op: String, details: => String, exc: Throwable, weight: Int = 1)(using Context): Nothing = - if ctx.settings.XnoDecodeStacktraces.value then + if ctx.settings.XnoEnrichErrorMessages.value then throw exc else exc match case _: RecursionOverflow => diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 7fd6444746ce..7b80c7c80a21 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -392,7 +392,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) { } catch case ex: Throwable => - if !ctx.settings.XnoDecodeStacktraces.value + if !ctx.settings.XnoEnrichErrorMessages.value && handleRecursive.underlyingStackOverflowOrNull(ex) != null then throw StackSizeExceeded(mdef) else @@ -941,7 +941,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) { em"""Recursion limit exceeded while pickling ${ex.mdef} |in ${ex.mdef.symbol.showLocated}. |You could try to increase the stacksize using the -Xss JVM option. - |For the unprocessed stack trace, compile with -Xno-decode-stacktraces.""", + |For the unprocessed stack trace, compile with -Xno-enrich-error-messages.""", ex.mdef.srcPos) def missing = forwardSymRefs.keysIterator diff --git a/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala b/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala index a412848eaa98..07834684d33b 100644 --- a/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala +++ b/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala @@ -105,7 +105,7 @@ class ScalaSettingsTests: createTestCase(settings.YdropComments , settings.XdropComments), createTestCase(settings.YcookComments , settings.XcookComments), createTestCase(settings.YreadComments , settings.XreadComments), - createTestCase(settings.YnoDecodeStacktraces , settings.XnoDecodeStacktraces), + createTestCase(settings.YnoDecodeStacktraces , settings.XnoEnrichErrorMessages), createTestCase(settings.YnoEnrichErrorMessages, settings.XnoEnrichErrorMessages), createTestCase(settings.YdebugMacros , settings.XdebugMacros), // createTestCase(settings.YjavaTasty , settings.XjavaTasty), @@ -134,7 +134,7 @@ class ScalaSettingsTests: createTestCase(settings.YdropComments , settings.XdropComments), createTestCase(settings.YcookComments , settings.XcookComments), createTestCase(settings.YreadComments , settings.XreadComments), - createTestCase(settings.YnoDecodeStacktraces , settings.XnoDecodeStacktraces), + createTestCase(settings.YnoDecodeStacktraces , settings.XnoEnrichErrorMessages), createTestCase(settings.YnoEnrichErrorMessages, settings.XnoEnrichErrorMessages), createTestCase(settings.YdebugMacros , settings.XdebugMacros), // createTestCase(settings.YjavaTasty , settings.XjavaTasty), @@ -175,7 +175,7 @@ class ScalaSettingsTests: createTestCase(settings.YdropComments , settings.XdropComments), createTestCase(settings.YcookComments , settings.XcookComments), createTestCase(settings.YreadComments , settings.XreadComments), - createTestCase(settings.YnoDecodeStacktraces , settings.XnoDecodeStacktraces), + createTestCase(settings.YnoDecodeStacktraces , settings.XnoEnrichErrorMessages), createTestCase(settings.YnoEnrichErrorMessages, settings.XnoEnrichErrorMessages), createTestCase(settings.YdebugMacros , settings.XdebugMacros), // createTestCase(settings.YjavaTasty , settings.XjavaTasty), diff --git a/tests/neg/i2887b.check b/tests/neg/i2887b.check index 5bd5f570fbf7..eb89f8582e5a 100644 --- a/tests/neg/i2887b.check +++ b/tests/neg/i2887b.check @@ -4,7 +4,7 @@ | Recursion limit exceeded. | Maybe there is an illegal cyclic reference? | If that's not the case, you could also try to increase the stacksize using the -Xss JVM option. - | For the unprocessed stack trace, compile with -Xno-decode-stacktraces. + | For the unprocessed stack trace, compile with -Xno-enrich-error-messages. | A recurring operation is (inner to outer): | | try to instantiate Z[Z]