@@ -61,7 +61,7 @@ object Expr {
61
61
* ```
62
62
*/
63
63
def betaReduce [F , Args <: Tuple , R , G ](f : Expr [F ])(using tf : TupledFunction [F , Args => R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
64
- import qctx .tasty .{ _ , given _ }
64
+ import qctx .tasty ._
65
65
tg.untupled(args => qctx.tasty.internal.betaReduce(f.unseal, args.toArray.toList.map(_.asInstanceOf [QuoteContext => Expr [_]](qctx).unseal)).seal.asInstanceOf [Expr [R ]])
66
66
}
67
67
@@ -74,19 +74,19 @@ object Expr {
74
74
* ```
75
75
*/
76
76
def betaReduceGiven [F , Args <: Tuple , R , G ](f : Expr [F ])(using tf : TupledFunction [F , Args ?=> R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
77
- import qctx .tasty .{ _ , given _ }
77
+ import qctx .tasty ._
78
78
tg.untupled(args => qctx.tasty.internal.betaReduce(f.unseal, args.toArray.toList.map(_.asInstanceOf [QuoteContext => Expr [_]](qctx).unseal)).seal.asInstanceOf [Expr [R ]])
79
79
}
80
80
81
81
/** Returns a null expresssion equivalent to `'{null}` */
82
82
def nullExpr : QuoteContext ?=> Expr [Null ] = qctx ?=> {
83
- import qctx .tasty .{ _ , given _ }
83
+ import qctx .tasty ._
84
84
Literal (Constant (null )).seal.asInstanceOf [Expr [Null ]]
85
85
}
86
86
87
87
/** Returns a unit expresssion equivalent to `'{}` or `'{()}` */
88
88
def unitExpr : QuoteContext ?=> Expr [Unit ] = qctx ?=> {
89
- import qctx .tasty .{ _ , given _ }
89
+ import qctx .tasty ._
90
90
Literal (Constant (())).seal.asInstanceOf [Expr [Unit ]]
91
91
}
92
92
@@ -95,7 +95,7 @@ object Expr {
95
95
* will be equivalent to `'{ $s1; $s2; ...; $e }`.
96
96
*/
97
97
def block [T ](statements : List [Expr [_]], expr : Expr [T ])(using qctx : QuoteContext ): Expr [T ] = {
98
- import qctx .tasty .{ _ , given _ }
98
+ import qctx .tasty ._
99
99
Block (statements.map(_.unseal), expr.unseal).seal.asInstanceOf [Expr [T ]]
100
100
}
101
101
@@ -184,7 +184,7 @@ object Expr {
184
184
185
185
/** Given a tuple of the form `(Expr[A1], ..., Expr[An])`, outputs a tuple `Expr[(A1, ..., An)]`. */
186
186
def ofTuple [T <: Tuple : Tuple .IsMappedBy [Expr ]: Type ](tup : T )(using qctx : QuoteContext ): Expr [Tuple .InverseMap [T , Expr ]] = {
187
- import qctx .tasty .{ _ , given _ }
187
+ import qctx .tasty ._
188
188
val elems : Seq [Expr [_]] = tup.asInstanceOf [Product ].productIterator.toSeq.asInstanceOf [Seq [Expr [_]]]
189
189
ofTuple(elems).cast[Tuple .InverseMap [T , Expr ]]
190
190
}
@@ -198,7 +198,7 @@ object Expr {
198
198
* @param qctx current context
199
199
*/
200
200
def summon [T ](using tpe : Type [T ])(using qctx : QuoteContext ): Option [Expr [T ]] = {
201
- import qctx .tasty .{ _ , given _ }
201
+ import qctx .tasty ._
202
202
searchImplicit(tpe.unseal.tpe) match {
203
203
case iss : ImplicitSearchSuccess => Some (iss.tree.seal.asInstanceOf [Expr [T ]])
204
204
case isf : ImplicitSearchFailure => None
0 commit comments