File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ import scala.quoted.show.SyntaxHighlight
66class Expr [+ T ] private [scala] {
77
88 /** Show a source code like representation of this expression without syntax highlight */
9- def show (using qctx : QuoteContext ): String = qctx.show(this , SyntaxHighlight .plain)
9+ def show (using qctx : QuoteContext ): String =
10+ this .unseal.showWith(SyntaxHighlight .plain)
1011
1112 /** Show a source code like representation of this expression */
12- def show (syntaxHighlight : SyntaxHighlight )(using qctx : QuoteContext ): String = qctx.show(this , syntaxHighlight)
13+ def show (syntaxHighlight : SyntaxHighlight )(using qctx : QuoteContext ): String =
14+ this .unseal.showWith(syntaxHighlight)
1315
1416 /** Return the value of this expression.
1517 *
Original file line number Diff line number Diff line change @@ -29,18 +29,6 @@ class QuoteContext(val tasty: scala.tasty.Reflection) { self =>
2929 val tasty : self.tasty.type
3030 }
3131
32- /** Show the fully elaborated source code representation of an expression */
33- def show (expr : Expr [_], syntaxHighlight : SyntaxHighlight ): String = {
34- import tasty .{_ , given _ }
35- expr.unseal(using this ).showWith(syntaxHighlight)
36- }
37-
38- /** Show the fully elaborated source code representation of a type */
39- def show (tpe : Type [_], syntaxHighlight : SyntaxHighlight ): String = {
40- import tasty .{_ , given _ }
41- tpe.unseal(using this ).showWith(syntaxHighlight)
42- }
43-
4432 /** Report an error at the position of the macro expansion */
4533 def error (msg : => String ): Unit = {
4634 import tasty .{_ , given _ }
Original file line number Diff line number Diff line change @@ -7,10 +7,12 @@ class Type[T <: AnyKind] private[scala] {
77 type `$splice` = T
88
99 /** Show a source code like representation of this type without syntax highlight */
10- def show (using qctx : QuoteContext ): String = qctx.show(this , SyntaxHighlight .plain)
10+ def show (using qctx : QuoteContext ): String =
11+ this .unseal.showWith(SyntaxHighlight .plain)
1112
1213 /** Show a source code like representation of this type */
13- def show (syntaxHighlight : SyntaxHighlight )(using qctx : QuoteContext ): String = qctx.show(this , syntaxHighlight)
14+ def show (syntaxHighlight : SyntaxHighlight )(using qctx : QuoteContext ): String =
15+ this .unseal.showWith(syntaxHighlight)
1416
1517 /** View this expression `quoted.Type[T]` as a `TypeTree` */
1618 def unseal (using qctx : QuoteContext ): qctx.tasty.TypeTree =
You can’t perform that action at this time.
0 commit comments