File tree Expand file tree Collapse file tree 4 files changed +11
-13
lines changed
compiler/src/dotty/tools/dotc/quoted Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ import scala.runtime.quoted._
55
66/** Default runners for quoted expressions */
77object Runners {
8- implicit def runner [T ]: Runner [T ] = (expr : Expr [T ]) => new QuoteDriver ().run(expr)
9- implicit def show [T ]: Show [T ] = (expr : Expr [T ]) => new QuoteDriver ().show(expr)
8+ implicit def runner [T ]: Runner [T ] = new Runner [T ] {
9+
10+ def run (expr : Expr [T ]): T =
11+ new QuoteDriver ().run(expr)
12+
13+ def show (expr : Expr [T ]): String =
14+ new QuoteDriver ().show(expr)
15+ }
1016}
Original file line number Diff line number Diff line change 11package scala .quoted
22
3- import scala .runtime .quoted .{ Runner , Show }
3+ import scala .runtime .quoted .Runner
44
55abstract class Expr [T ] extends Quoted {
66 final def unary_~ : T = throw new Error (" ~ should have been compiled away" )
77 final def run (implicit runner : Runner [T ]): T = runner.run(this )
8- final def show (implicit runner : Show [T ]): String = runner.run (this )
8+ final def show (implicit runner : Runner [T ]): String = runner.show (this )
99}
1010
1111object Expr {
Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ import scala.quoted.Expr
66@ implicitNotFound(" Could not find implicit Runner. Default runner can must be imported with `import dotty.tools.dotc.quoted.Runners._`" )
77trait Runner [T ] {
88 def run (expr : Expr [T ]): T
9+ def show (expr : Expr [T ]): String
910}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments