Skip to content

Commit 8100200

Browse files
committed
Add -Ydebug-macros option
1 parent fbfe5ca commit 8100200

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,6 @@ private sealed trait YSettings:
399399
val YinstrumentDefs: Setting[Boolean] = BooleanSetting("-Yinstrument-defs", "Add instrumentation code that counts method calls; needs -Yinstrument to be set, too.")
400400

401401
val YforceInlineWhileTyping: Setting[Boolean] = BooleanSetting("-Yforce-inline-while-typing", "Make non-transparent inline methods inline when typing. Emulates the old inlining behavior of 3.0.0-M3.")
402+
403+
val YdebugMacros: Setting[Boolean] = BooleanSetting("-Ydebug-macros", "Show debug info when quote pattern match fails")
402404
end YSettings

compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ import dotty.tools.dotc.util.optional
105105
object QuoteMatcher {
106106
import tpd.*
107107

108-
// TODO use flag from Context. Maybe -debug or add -debug-macros
109-
private inline val debug = false
110-
111108
/** Sequence of matched expressions.
112109
* These expressions are part of the scrutinee and will be bound to the quote pattern term splices.
113110
*/
@@ -465,7 +462,7 @@ object QuoteMatcher {
465462
notMatched
466463
end runMatch
467464

468-
if (debug)
465+
if (ctx.settings.YdebugMacros.value)
469466
try {
470467
runMatch()
471468
} catch {

0 commit comments

Comments
 (0)