File tree 1 file changed +27
-18
lines changed
compiler/src/scala/quoted/runtime/impl 1 file changed +27
-18
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,8 @@ object QuoteMatcher {
234
234
case _ => None
235
235
end TypeTreeTypeTest
236
236
237
- val res = pattern match
237
+ def runMatch (): optional[MatchingExprs ] =
238
+ pattern match
238
239
239
240
/* Term hole */
240
241
// Match a scala.internal.Quoted.patternHole typed as a repeated argument and return the scrutinee tree
@@ -463,24 +464,32 @@ object QuoteMatcher {
463
464
// No Match
464
465
case _ =>
465
466
notMatched
467
+ end runMatch
468
+
469
+ if (debug)
470
+ try {
471
+ runMatch()
472
+ } catch {
473
+ case e : RuntimeException =>
474
+ val quotes = QuotesImpl ()
475
+ println(
476
+ s """ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
477
+ |Scrutinee
478
+ | ${scrutinee.show}
479
+ |did not match pattern
480
+ | ${pattern.show}
481
+ |
482
+ |with environment: ${summon[Env ]}
483
+ |
484
+ |Scrutinee: ${quotes.reflect.Printer .TreeStructure .show(scrutinee.asInstanceOf )}
485
+ |Pattern: ${quotes.reflect.Printer .TreeStructure .show(pattern.asInstanceOf )}
486
+ |
487
+ | """ .stripMargin)
488
+ throw e
489
+ }
490
+ else
491
+ runMatch()
466
492
467
- if (debug && res == notMatched)
468
- val quotes = QuotesImpl ()
469
- println(
470
- s """ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
471
- |Scrutinee
472
- | ${scrutinee.show}
473
- |did not match pattern
474
- | ${pattern.show}
475
- |
476
- |with environment: ${summon[Env ]}
477
- |
478
- |Scrutinee: ${quotes.reflect.Printer .TreeStructure .show(scrutinee.asInstanceOf )}
479
- |Pattern: ${quotes.reflect.Printer .TreeStructure .show(pattern.asInstanceOf )}
480
- |
481
- | """ .stripMargin)
482
-
483
- res
484
493
end =?=
485
494
486
495
end extension
You can’t perform that action at this time.
0 commit comments