Explicitly specify type parameters in calls to KCons in KList builder.

scalac couldn't infer the type constructor otherwise.
This commit is contained in:
Mark Harrah 2012-11-18 09:20:24 -05:00
parent 46b739aa5a
commit a9289ad0ce
2 changed files with 11 additions and 1 deletions

View File

@ -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(

View File

@ -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.