diff --git a/main/settings/src/test/scala/UsageTest.scala b/main/settings/src/test/scala/UsageTest.scala index f1f7a51bb..91906fdbc 100644 --- a/main/settings/src/test/scala/UsageTest.scala +++ b/main/settings/src/test/scala/UsageTest.scala @@ -50,6 +50,8 @@ object Assign bk ++= Seq(z.value) )*/ + val zz = Def.task { mk.value + tk.value + mk.value + tk.value + mk.value + tk.value + mk.value + tk.value + mk.value + tk.value + mk.value + tk.value } + import DefaultParsers._ val p = Def.setting { name.value ~> Space ~> ID } val is = Seq( diff --git a/util/appmacro/KListBuilder.scala b/util/appmacro/KListBuilder.scala index 7ae0696d0..551566419 100644 --- a/util/appmacro/KListBuilder.scala +++ b/util/appmacro/KListBuilder.scala @@ -41,8 +41,16 @@ object KListBuilder extends TupleBuilder case Nil => revBindings.reverse } + private[this] def makeKList(revInputs: Inputs[c.universe.type], klist: Tree, klistType: Type): Tree = + revInputs match { + case in :: tail => + val next = ApplyTree(TypeApply(Ident(kcons), TypeTree(in.tpe) :: TypeTree(klistType) :: TypeTree(mTC) :: Nil), in.expr :: klist :: Nil) + makeKList(tail, next, appliedType(kconsTC, in.tpe :: klistType :: mTC :: Nil)) + case Nil => klist + } + /** The input trees combined in a KList */ - val klist = (inputs :\ (knil: Tree))( (in, klist) => ApplyTree(kcons, in.expr, klist) ) + val klist = makeKList(inputs.reverse, knil, knilType) /** The input types combined in a KList type. The main concern is tracking the heterogeneous types. * The type constructor is tcVariable, so that it can be applied to [X] X or M later.