From f3a6e9d0c1695d14bc632a893c9716d9ae2f9439 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Wed, 5 Oct 2016 10:33:33 -0500 Subject: [PATCH] Add some singleton type arguments --- .../src/main/scala/sbt/std/InputConvert.scala | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/main-settings/src/main/scala/sbt/std/InputConvert.scala b/main-settings/src/main/scala/sbt/std/InputConvert.scala index 0a7b99ab5..9b185c3c0 100644 --- a/main-settings/src/main/scala/sbt/std/InputConvert.scala +++ b/main-settings/src/main/scala/sbt/std/InputConvert.scala @@ -10,9 +10,9 @@ import sbt.internal.util.appmacro.{ Convert, Converted } object InputInitConvert extends Convert { def apply[T: c.WeakTypeTag](c: blackbox.Context)(nme: String, in: c.Tree): Converted[c.type] = nme match { - case InputWrapper.WrapInitName => Converted.Success(in) - case InputWrapper.WrapInitTaskName => Converted.Failure(in.pos, initTaskErrorMessage) - case _ => Converted.NotApplicable + case InputWrapper.WrapInitName => Converted.Success[c.type](in) + case InputWrapper.WrapInitTaskName => Converted.Failure[c.type](in.pos, initTaskErrorMessage) + case _ => Converted.NotApplicable[c.type] } private def initTaskErrorMessage = "Internal sbt error: initialize+task wrapper not split" @@ -22,9 +22,9 @@ object InputInitConvert extends Convert { object ParserConvert extends Convert { def apply[T: c.WeakTypeTag](c: blackbox.Context)(nme: String, in: c.Tree): Converted[c.type] = nme match { - case ParserInput.WrapName => Converted.Success(in) - case ParserInput.WrapInitName => Converted.Failure(in.pos, initParserErrorMessage) - case _ => Converted.NotApplicable + case ParserInput.WrapName => Converted.Success[c.type](in) + case ParserInput.WrapInitName => Converted.Failure[c.type](in.pos, initParserErrorMessage) + case _ => Converted.NotApplicable[c.type] } private def initParserErrorMessage = "Internal sbt error: initialize+parser wrapper not split" @@ -33,7 +33,7 @@ object ParserConvert extends Convert { /** Convert instance for plain `Task`s not within the settings system. */ object TaskConvert extends Convert { def apply[T: c.WeakTypeTag](c: blackbox.Context)(nme: String, in: c.Tree): Converted[c.type] = - if (nme == InputWrapper.WrapTaskName) Converted.Success(in) else Converted.NotApplicable + if (nme == InputWrapper.WrapTaskName) Converted.Success[c.type](in) else Converted.NotApplicable[c.type] } /** Converts an input `Tree` of type `Initialize[T]`, `Initialize[Task[T]]`, or `Task[T]` into a `Tree` of type `Initialize[Task[T]]`.*/ @@ -41,23 +41,23 @@ object FullConvert extends Convert { import InputWrapper._ def apply[T: c.WeakTypeTag](c: blackbox.Context)(nme: String, in: c.Tree): Converted[c.type] = nme match { - case WrapInitTaskName => Converted.Success(in) - case WrapPreviousName => Converted.Success(in) + case WrapInitTaskName => Converted.Success[c.type](in) + case WrapPreviousName => Converted.Success[c.type](in) case WrapInitName => wrapInit[T](c)(in) case WrapTaskName => wrapTask[T](c)(in) - case _ => Converted.NotApplicable + case _ => Converted.NotApplicable[c.type] } private def wrapInit[T](c: blackbox.Context)(tree: c.Tree): Converted[c.type] = { val i = c.Expr[Initialize[T]](tree) val t = c.universe.reify(Def.toITask(i.splice)).tree - Converted.Success(t) + Converted.Success[c.type](t) } private def wrapTask[T](c: blackbox.Context)(tree: c.Tree): Converted[c.type] = { val i = c.Expr[Task[T]](tree) val t = c.universe.reify(Def.valueStrict[Task[T]](i.splice)).tree - Converted.Success(t) + Converted.Success[c.type](t) } } @@ -69,13 +69,13 @@ object InitParserConvert extends Convert { def apply[T: c.WeakTypeTag](c: blackbox.Context)(nme: String, in: c.Tree): Converted[c.type] = nme match { case ParserInput.WrapName => wrap[T](c)(in) - case ParserInput.WrapInitName => Converted.Success(in) - case _ => Converted.NotApplicable + case ParserInput.WrapInitName => Converted.Success[c.type](in) + case _ => Converted.NotApplicable[c.type] } private def wrap[T](c: blackbox.Context)(tree: c.Tree): Converted[c.type] = { val e = c.Expr[State => Parser[T]](tree) val t = c.universe.reify { Def.valueStrict[State => Parser[T]](e.splice) } - Converted.Success(t.tree) + Converted.Success[c.type](t.tree) } }