Skip to content

Commit 334930e

Browse files
committed
Workaround stack issues
1 parent f6bc23f commit 334930e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/src/scala/quoted/unsafe/UnsafeExpr.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ object UnsafeExpr {
4040
*/
4141
def open[T1, R, X](f: Expr[T1 => R])(content: (Expr[R], [t] => Expr[t] => Expr[T1] => Expr[t]) => X)(given qctx: QuoteContext): X = {
4242
import qctx.tasty.{given, _}
43-
val (params, bodyExpr) = paramsAndBody(f)
43+
val (params, bodyExpr) = paramsAndBody[R](f)
4444
content(bodyExpr, [t] => (e: Expr[t]) => (v: Expr[T1]) => bodyFn[t](e.unseal, params, List(v.unseal)).seal.asInstanceOf[Expr[t]])
4545
}
4646

4747
def open[T1, T2, R, X](f: Expr[(T1, T2) => R])(content: (Expr[R], [t] => Expr[t] => (Expr[T1], Expr[T2]) => Expr[t]) => X)(given qctx: QuoteContext)(given DummyImplicit): X = {
4848
import qctx.tasty.{given, _}
49-
val (params, bodyExpr) = paramsAndBody(f)
49+
val (params, bodyExpr) = paramsAndBody[R](f)
5050
content(bodyExpr, [t] => (e: Expr[t]) => (v1: Expr[T1], v2: Expr[T2]) => bodyFn[t](e.unseal, params, List(v1.unseal, v2.unseal)).seal.asInstanceOf[Expr[t]])
5151
}
5252

5353
def open[T1, T2, T3, R, X](f: Expr[(T1, T2, T3) => R])(content: (Expr[R], [t] => Expr[t] => (Expr[T1], Expr[T2], Expr[T3]) => Expr[t]) => X)(given qctx: QuoteContext)(given DummyImplicit, DummyImplicit): X = {
5454
import qctx.tasty.{given, _}
55-
val (params, bodyExpr) = paramsAndBody(f)
55+
val (params, bodyExpr) = paramsAndBody[R](f)
5656
content(bodyExpr, [t] => (e: Expr[t]) => (v1: Expr[T1], v2: Expr[T2], v3: Expr[T3]) => bodyFn[t](e.unseal, params, List(v1.unseal, v2.unseal, v3.unseal)).seal.asInstanceOf[Expr[t]])
5757
}
5858

59-
private def paramsAndBody[R](given qctx: QuoteContext)(f: Expr[Any]) = {
59+
private def paramsAndBody[R](given qctx: QuoteContext)(f: Expr[Any]): (List[qctx.tasty.ValDef], Expr[R]) = {
6060
import qctx.tasty.{given, _}
6161
val Block(List(DefDef("$anonfun", Nil, List(params), _, Some(body))), Closure(Ident("$anonfun"), None)) = f.unseal.etaExpand
6262
(params, body.seal.asInstanceOf[Expr[R]])

0 commit comments

Comments
 (0)