File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/src/dotty/tools/dotc/quoted Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,15 @@ object QuoteContextImpl {
1616
1717 def showTree (tree : tpd.Tree )(using Context ): String = {
1818 val qctx = QuoteContextImpl ()(using MacroExpansion .context(tree))
19- val reflCtx = ctx.asInstanceOf [qctx.tasty.Context ]
20- val reflTree = tree.asInstanceOf [qctx.tasty.Tree ]
2119 val syntaxHighlight =
2220 if (ctx.settings.color.value == " always" ) SyntaxHighlight .ANSI
2321 else SyntaxHighlight .plain
24- new scala.tasty.reflect. SourceCodePrinter [qctx.tasty.type ](qctx.tasty)( syntaxHighlight).showTree(reflTree)( using reflCtx )
22+ show( using qctx)(tree. asInstanceOf [qctx.tasty.Tree ], syntaxHighlight)( using ctx. asInstanceOf [qctx.tasty. Context ] )
2523 }
2624
25+ private def show (using qctx : QuoteContext )(tree : qctx.tasty.Tree , syntaxHighlight : SyntaxHighlight )(using qctx.tasty.Context ) =
26+ tree.showWith(syntaxHighlight)
27+
2728 private [dotty] def checkScopeId (id : ScopeId )(using Context ): Unit =
2829 if (id != scopeId)
2930 throw new scala.quoted.ScopeException (" Cannot call `scala.quoted.staging.run(...)` within a macro or another `run(...)`" )
You can’t perform that action at this time.
0 commit comments