From 2929e4e72494cdad23c9a31ddeebac993326252b Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Mon, 28 Jan 2013 17:14:53 -0500 Subject: [PATCH] Reduce InputTask to the ideal wrapper around 'State => Parser[Initialize[Task[T]]]' Ref #407. --- .../appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala b/util/appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala index a62846e78..3afc0d617 100644 --- a/util/appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala +++ b/util/appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala @@ -143,6 +143,13 @@ final class ContextUtil[C <: Context](val ctx: C) /** >: Nothing <: Any */ def emptyTypeBounds: TypeBounds = TypeBounds(definitions.NothingClass.toType, definitions.AnyClass.toType) + def functionType(args: List[Type], result: Type): Type = + { + val global: Global = ctx.universe.asInstanceOf[Global] + val tpe = global.definitions.functionType(args.asInstanceOf[List[global.Type]], result.asInstanceOf[global.Type]) + tpe.asInstanceOf[Type] + } + /** Create a Tree that references the `val` represented by `vd`. */ def refVal(vd: ValDef): Tree = {