diff --git a/quill-sql/src/main/scala/io/getquill/generic/GenericDecoder.scala b/quill-sql/src/main/scala/io/getquill/generic/GenericDecoder.scala index 3fa74d68..b73e0f5d 100644 --- a/quill-sql/src/main/scala/io/getquill/generic/GenericDecoder.scala +++ b/quill-sql/src/main/scala/io/getquill/generic/GenericDecoder.scala @@ -385,46 +385,7 @@ object ConstructDecoded { '{EmptyTuple} } else if (tpe <:< TypeRepr.of[Tuple]) { '{scala.runtime.Tuples.fromIArray(IArray(${Varargs(terms)})).asInstanceOf[T]} - // Alternative version: - // val t = - // Varargs - // Type.of[T] match { - // case '[h *: t] => - // val construct = Type.of[t] match { - // case '[EmptyTuple] => - // println(" ConstructDecoded: t=et") - // Apply( - // TypeApply( - // Select(New(TypeTree.of[Tuple1[h]]), constructor), - // types.map { tpe => - // tpe match { - // case '[tt] => TypeTree.of[tt] - // } - // } - // ), - // terms.map(_.asTerm) - // ) - // case _ => - // val typeTrees = types.map { tpe => - // tpe match { - // case '[tt] => TypeTree.of[tt] - // } - // } - // val terms2 = terms.map(_.asTerm) - // val ttt = TypeTree.of[T] - - // println(s" ConstructDecoded: t=t; ttt = $ttt; typeTrees = $typeTrees; terms2 = $terms2") - // Apply( - // Select(New(TypeTree.of[IArray[Object]]), constructor), - // // VarArgs - // terms2 - // ) - // } - // println(s"=========== Create from Tuple Constructor: Tree: $construct ===========") - // println(s"=========== Create from Tuple Constructor ${Format.Expr(construct.asExprOf[T])} ===========") - // construct.asExprOf[T] - // // If we are a case class with no generic parameters, we can easily construct it - // } + // If we are a case class with no generic parameters, we can easily construct it } else if (tpe.classSymbol.exists(_.flags.is(Flags.Case)) && !constructor.paramSymss.exists(_.exists(_.isTypeParam))) { val construct = Apply( diff --git a/quill-sql/src/main/scala/io/getquill/parser/Parser.scala b/quill-sql/src/main/scala/io/getquill/parser/Parser.scala index be033eb5..588c2fd1 100644 --- a/quill-sql/src/main/scala/io/getquill/parser/Parser.scala +++ b/quill-sql/src/main/scala/io/getquill/parser/Parser.scala @@ -199,21 +199,9 @@ object ArbitraryTupleConstructionInlined { t match { case Inlined( - // Some(Apply( - // TypeApply( - // Select( - // Inlined(_,_, - // Typed(AsInstanceOf(TupleCons(a,b)), _) - // ), - // "*:" - // ), - // _ - // ), - // _ - // )), - _, - List(ValDef("Tuple_this", _, Some(prevTuple))), - Typed(AsInstanceOf(TupleCons(head, TIdent("Tuple_this"))), _) + _, + List(ValDef("Tuple_this", _, Some(prevTuple))), + Typed(AsInstanceOf(TupleCons(head, TIdent("Tuple_this"))), _) ) => Some((head, prevTuple)) case _ => None @@ -254,7 +242,6 @@ class ArbitraryTupleBlockParser(val rootParse: Parser)(using Quotes, TranspileCo val aAst = rootParse(a) ast.Tuple(List(aAst)) case inlined@Unseal(ArbitraryTupleConstructionInlined(singleValue, prevTuple)) => - //printExpr(inlined, "singleValue ArbitraryTupleConstructionInlined") val headAst = rootParse(singleValue.asExpr) val prevTupleAst = rootParse(prevTuple.asExpr) prevTupleAst match { @@ -263,7 +250,6 @@ class ArbitraryTupleBlockParser(val rootParse: Parser)(using Quotes, TranspileCo throw IllegalArgumentException(s"Unexpected tuple ast ${prevTupleAst}") } case block@Unseal(TBlock(parts, ArbitraryTupleConstructionInlined(head,Typed(AsInstanceOf(TupleCons(head2,TIdent("Tuple_this"))), _)) )) if (parts.length > 0) => - //println(s"Large block. parts.size=${parts.size}; parts:\n- ${parts.mkString("\n- ")}") val headAst = rootParse(head.asExpr) val head2Ast = rootParse(head2.asExpr) val partsAsts = headAst :: head2Ast :: parts.reverse.flatMap{