File tree 3 files changed +8
-16
lines changed
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
6
6
class Expr [+ T ] private [scala] {
7
7
8
8
/** 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)
10
11
11
12
/** 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)
13
15
14
16
/** Return the value of this expression.
15
17
*
Original file line number Diff line number Diff line change @@ -29,18 +29,6 @@ class QuoteContext(val tasty: scala.tasty.Reflection) { self =>
29
29
val tasty : self.tasty.type
30
30
}
31
31
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
-
44
32
/** Report an error at the position of the macro expansion */
45
33
def error (msg : => String ): Unit = {
46
34
import tasty .{_ , given _ }
Original file line number Diff line number Diff line change @@ -7,10 +7,12 @@ class Type[T <: AnyKind] private[scala] {
7
7
type `$splice` = T
8
8
9
9
/** 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)
11
12
12
13
/** 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)
14
16
15
17
/** View this expression `quoted.Type[T]` as a `TypeTree` */
16
18
def unseal (using qctx : QuoteContext ): qctx.tasty.TypeTree =
You can’t perform that action at this time.
0 commit comments