File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
staging/test-resources/repl-staging Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11scala> import scala.quoted._
22scala> def assertImpl(expr: Expr[Boolean])(using q: Quotes) = '{ if !($expr) then throw new AssertionError("failed assertion")}
33def assertImpl
4- (expr: quoted.Expr[Boolean])(using q: quoted.Quotes): quoted.Expr[Unit]
4+ (expr: quoted.Expr[Boolean])(using q: quoted.Quotes): scala. quoted.Expr[Unit]
55scala> inline def assert(expr: => Boolean): Unit = ${ assertImpl('{expr}) }
66def assert(expr: => Boolean): Unit
77
Original file line number Diff line number Diff line change 11scala> import scala.quoted._
22scala> def foo(expr: Expr[Any])(using Quotes) = expr match { case '{ $x: t } => '{ $x: Any } }
3- def foo(expr: quoted.Expr[Any])(using x$2: quoted.Quotes): quoted.Expr[Any]
3+ def foo
4+ (expr: quoted.Expr[Any])(using x$2: quoted.Quotes): scala.quoted.Expr[Any]
45scala> def bar(expr: Expr[Any])(using Quotes) = expr match { case '{ $x: t } => '{ val a: t = ??? ; ???} }
5- def bar(expr: quoted.Expr[Any])(using x$2: quoted.Quotes): quoted.Expr[Nothing]
6+ def bar
7+ (expr: quoted.Expr[Any])(using x$2: quoted.Quotes): scala.quoted.Expr[Nothing]
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ scala> import quoted.staging.{Compiler => StagingCompiler, _}
33scala> implicit def compiler: StagingCompiler = StagingCompiler.make(getClass.getClassLoader)
44def compiler: quoted.staging.Compiler
55scala> def v(using Quotes) = '{ (if true then Some(1) else None).map(v => v+1) }
6- def v(using x$1: quoted.Quotes): quoted.Expr[Option[Int]]
6+ def v(using x$1: quoted.Quotes): scala. quoted.Expr[Option[Int]]
77scala> scala.quoted.staging.withQuotes(v.show)
88val res0: String = (if (true) scala.Some.apply[scala.Int](1) else scala.None).map[scala.Int](((v: scala.Int) => v.+(1)))
99scala> scala.quoted.staging.run(v)
You can’t perform that action at this time.
0 commit comments