File tree 3 files changed +5
-7
lines changed
3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
- ((g: (y: scala.Int)scala.Int, n: scala.Int) => g(n))
2
- ((g: (y: scala.Int, z: scala.Int)scala.Int) => g(1, 2))
3
- ((g2: (x$1: scala.math.Ordered[scala.Int])scala.Boolean, ord: scala.math.Ordered[scala.Int]) => (g2(ord).||(2.<(3)): scala.Boolean))
1
+ str_from_macro 1st 2nd
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import scala.quoted.*
3
3
inline def testExpr (inline body : Any ) = $ { testExprImpl(' body ) }
4
4
def testExprImpl (body : Expr [Any ])(using Quotes ): Expr [String ] =
5
5
body match
6
- case ' { def g (y : Int ) = " hello " * y; $a(g): String } =>
7
- ' { $a((z: Int ) => " this is " + z.toString() ) }
6
+ case ' { def g (y : String ) = " placeholder " + y; $a(g): String } =>
7
+ ' { $a((z: String ) => " str_from_macro " + z) }
8
8
case _ => Expr (" not matched" )
9
9
10
10
// TODO issue-17105: Clean this up if not neccessary
Original file line number Diff line number Diff line change 1
- @ main def app : Unit =
2
- testExpr { def f (x : Int ) = " hello " * x; f(0 ) + " bye " }
1
+ @ main def Test : Unit =
2
+ println( testExpr { def f (x : String ) = " placeholder " + x; f(" 1st " ) + " 2nd " })
You can’t perform that action at this time.
0 commit comments