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