@@ -16,7 +16,7 @@ class SLSelect[S]:
1616
1717 def fold [S ](s0: S )(step : (S ,SLSelect [S ])=> S ): S = {
1818 ???
19- }
19+ }
2020
2121 def fold_async [S ](s0: S )(step : (S ,SLSelect [S ])=> Future [S ]): Future [S ] = {
2222 ???
@@ -27,7 +27,7 @@ class SLSelect[S]:
2727 await(s0.onRead(ch)(f).runAsync())
2828
2929 def runAsync (): Future [S ] = ???
30-
30+
3131
3232
3333object X :
@@ -36,30 +36,30 @@ object X:
3636 processImpl[T ](' f )
3737 }
3838
39- def processImpl [T : Type ](t: Expr [T ])(using Quotes ): Expr [Future [T ]] =
39+ def processImpl [T : Type ](t: Expr [T ])(using Quotes ): Expr [Future [T ]] =
4040 import quotes .reflect ._
4141 val r = processTree[T ](t.asTerm)
4242 r.asExprOf[Future [T ]]
4343
44-
45- def processTree [T : Type ](using Quotes )(t : quotes.reflect.Term ): quotes.reflect.Term =
44+
45+ def processTree [T : Type ](using Quotes )(t : quotes.reflect.Term ): quotes.reflect.Term =
4646 import quotes .reflect ._
4747 val r : Term = t match
4848 case Inlined (_,List (),body) => processTree(body)
49- case Inlined (d,bindings,body) =>
49+ case Inlined (d,bindings,body) =>
5050 Inlined (d,bindings,processTree[T ](body))
5151 case Block (stats,expr) => Block (stats,processTree(expr))
5252 case Apply (Apply (TypeApply (Select (x," fold" ),targs),List (state)),List (fun)) =>
53- val nFun = processLambda[T ](fun)
53+ val nFun = processLambda[T ](fun)
5454 Apply (Apply (TypeApply (Select .unique(x," fold_async" ),targs),List (state)),List (nFun))
5555 case Apply (TypeApply (Ident (" await" ),targs),List (body)) => body
56- case Typed (x,tp) => Typed (processTree(x), Inferred (TypeRepr .of[Future ].appliedTo(tp.tpe)) )
56+ case Typed (x : Term ,tp) => Typed (processTree(x), Inferred (TypeRepr .of[Future ].appliedTo(tp.tpe)) )
5757 case _ => throw new RuntimeException (s " tree not recoginized: $t" )
5858 val checker = new TreeMap () {}
5959 checker.transformTerm(r)(Symbol .spliceOwner)
6060 r
61-
62- def processLambda [T : Type ](using Quotes )(fun : quotes.reflect.Term ): quotes.reflect.Term =
61+
62+ def processLambda [T : Type ](using Quotes )(fun : quotes.reflect.Term ): quotes.reflect.Term =
6363 import quotes .reflect ._
6464
6565 def changeArgs (oldArgs: List [Tree ], newArgs: List [Tree ], body: Term , owner : Symbol ): Term =
0 commit comments