diff --git a/tests/run-staging/i7897.scala b/tests/run-staging/i7897.scala new file mode 100644 index 000000000000..0abd3ce0eec2 --- /dev/null +++ b/tests/run-staging/i7897.scala @@ -0,0 +1,14 @@ +import scala.quoted._, staging._ + +given Toolbox = Toolbox.make(getClass.getClassLoader) + +val f: Array[Int] => Int = run { + val stagedSum: Expr[Array[Int] => Int] = '{ (arr: Array[Int]) => 6 } + println(stagedSum.show) + stagedSum +} + +@main +def Test = { + f.apply(Array(1, 2, 3)) // Returns 6 +}