Skip to content

Commit

Permalink
Update test case for i17105
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptometer committed Jun 4, 2023
1 parent c7a88fa commit 8d73b97
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions tests/run-macros/i17105.check
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
((g: (y: scala.Int)scala.Int, n: scala.Int) => g(n))
((g: (y: scala.Int, z: scala.Int)scala.Int) => g(1, 2))
((g2: (x$1: scala.math.Ordered[scala.Int])scala.Boolean, ord: scala.math.Ordered[scala.Int]) => (g2(ord).||(2.<(3)): scala.Boolean))
str_from_macro 1st 2nd
4 changes: 2 additions & 2 deletions tests/run-macros/i17105/Macro_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import scala.quoted.*
inline def testExpr(inline body: Any) = ${ testExprImpl('body) }
def testExprImpl(body: Expr[Any])(using Quotes): Expr[String] =
body match
case '{ def g(y: Int) = "hello" * y; $a(g): String } =>
'{ $a((z:Int) => "this is " + z.toString()) }
case '{ def g(y: String) = "placeholder" + y; $a(g): String } =>
'{ $a((z:String) => "str_from_macro " + z) }
case _ => Expr("not matched")

// TODO issue-17105: Clean this up if not neccessary
Expand Down
4 changes: 2 additions & 2 deletions tests/run-macros/i17105/Test_2.scala
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@main def app: Unit =
testExpr { def f(x: Int) = "hello" * x; f(0) + "bye" }
@main def Test: Unit =
println(testExpr { def f(x: String) = "placeholder" + x; f("1st") + " 2nd" })

0 comments on commit 8d73b97

Please sign in to comment.