File tree Expand file tree Collapse file tree 3 files changed +9
-42
lines changed
library/src/scala/tasty/util Expand file tree Collapse file tree 3 files changed +9
-42
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -45,11 +45,9 @@ object Macros {
4545 }
4646
4747 def power (n : Expr [Int ], x : Expr [Double ])(implicit reflect : Reflection ): Expr [Double ] = {
48- import reflect ._
49-
50- val Constant = new ConstantExtractor (reflect)
48+ import quoted .matching .Literal
5149 n match {
52- case Constant (n1) => powerCode(n1, x)
50+ case Literal (n1) => powerCode(n1, x)
5351 case _ => ' { dynamicPower($n, $x) }
5452 }
5553 }
Original file line number Diff line number Diff line change 11import scala .quoted ._
22import scala .quoted .autolift ._
33
4+ import scala .quoted .matching ._
5+
46import scala .tasty ._
57import scala .tasty .util ._
68
@@ -9,19 +11,16 @@ object Macros {
911 implicit inline def testMacro : Unit = $ {impl}
1012
1113 def impl (implicit reflect : Reflection ): Expr [Unit ] = {
12- import reflect ._
1314
1415 val buff = new StringBuilder
1516 def stagedPrintln (x : Any ): Unit = buff append java.util.Objects .toString(x) append " \n "
1617
17- val Constant = new ConstantExtractor (reflect)
18-
19- 3 .toExpr match { case Constant (n) => stagedPrintln(n) }
20- ' {4 } match { case Constant (n) => stagedPrintln(n) }
21- ' {" abc" } match { case Constant (n) => stagedPrintln(n) }
22- ' {null } match { case Constant (n) => stagedPrintln(n) }
18+ 3 .toExpr match { case Literal (n) => stagedPrintln(n) }
19+ ' {4 } match { case Literal (n) => stagedPrintln(n) }
20+ ' {" abc" } match { case Literal (n) => stagedPrintln(n) }
21+ ' {null } match { case Literal (n) => stagedPrintln(n) }
2322
24- ' {new Object } match { case Constant (n) => println(n); case _ => stagedPrintln(" OK" ) }
23+ ' {new Object } match { case Literal (n) => println(n); case _ => stagedPrintln(" OK" ) }
2524
2625 ' {print($ {buff.result()})}
2726 }
You can’t perform that action at this time.
0 commit comments