Skip to content

Commit b3cfa95

Browse files
committed
small optimisation
1 parent faf70f8 commit b3cfa95

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

library/src/scala/quoted/Expr.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,13 @@ object Expr {
218218
val tupleTpe = tupleTypeFromSeq(seq)
219219
tupleTpe.asType match
220220
case '[tpe] =>
221-
'{ Tuple.fromIArray(IArray(${Varargs(seq)}: _*)).asInstanceOf[tpe & Tuple] }
221+
'{ Tuple.fromIArray(IArray(${Varargs(seq)}*)).asInstanceOf[tpe & Tuple] }
222222

223223
private def tupleTypeFromSeq(seq: Seq[Expr[Any]])(using Quotes): quotes.reflect.TypeRepr =
224224
import quotes.reflect.*
225225
val consRef = Symbol.classSymbol("scala.*:").typeRef
226226
seq.foldLeft(TypeRepr.of[EmptyTuple]) { (ts, expr) =>
227-
expr match
228-
case '{ $e: t } => AppliedType(consRef, TypeRepr.of[t] :: ts :: Nil)
227+
AppliedType(consRef, expr.asTerm.tpe :: ts :: Nil)
229228
}
230229

231230
/** Given a tuple of the form `(Expr[A1], ..., Expr[An])`, outputs a tuple `Expr[(A1, ..., An)]`. */

0 commit comments

Comments
 (0)