Skip to content

Commit

Permalink
Reduce InputTask to the ideal wrapper around 'State => Parser[Initial…
Browse files Browse the repository at this point in the history
…ize[Task[T]]]'

Ref sbt#407.
  • Loading branch information
harrah committed Jan 28, 2013
1 parent e719c5f commit 2929e4e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions util/appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala
Expand Up @@ -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 =
{
Expand Down

0 comments on commit 2929e4e

Please sign in to comment.