Skip to content

Commit

Permalink
Revert "Fix task macro's handling of Symbol owners in <qual>.value"
Browse files Browse the repository at this point in the history
This reverts commit 3017bfc.

This was causing sbt to be unable to compile.  Reverting temporarily until
we have a shot at a full fix.
  • Loading branch information
jsuereth authored and eed3si9n committed Mar 21, 2014
1 parent c32195a commit fb74cd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
9 changes: 0 additions & 9 deletions sbt/src/sbt-test/project/setting-macro/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,3 @@ demo := {
val (n, s) = parser.parsed
s * n
}

// Tests for correct Symbol owner structure in the lifted qualifiers of
// the `.value` macro within a task macro. (#1150)
val touchIfChanged = taskKey[Unit]("")

touchIfChanged := {
val foo = (sourceDirectory in Compile).apply(base => base).value.get
()
}
22 changes: 10 additions & 12 deletions util/appmacro/src/main/scala/sbt/appmacro/ContextUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,17 @@ final class ContextUtil[C <: Context](val ctx: C)
object appTransformer extends Transformer
{
override def transform(tree: Tree): Tree =
tree match {
case ApplyTree(TypeApply(Select(_, nme), targ :: Nil), qual :: Nil) =>
changeOwner(qual, currentOwner, initialOwner) // Fixes https://github.com/sbt/sbt/issues/1150
subWrapper(nme.decoded, targ.tpe, qual, tree) match {
case Converted.Success(t, finalTx) => finalTx(t)
case Converted.Failure(p,m) => ctx.abort(p, m)
case _: Converted.NotApplicable[_] => super.transform(tree)
}
tree match
{
case ApplyTree(TypeApply(Select(_, nme), targ :: Nil), qual :: Nil) => subWrapper(nme.decoded, targ.tpe, qual, tree) match {
case Converted.Success(t, finalTx) => finalTx(t)
case Converted.Failure(p,m) => ctx.abort(p, m)
case _: Converted.NotApplicable[_] => super.transform(tree)
}
case _ => super.transform(tree)
}
}
appTransformer.atOwner(initialOwner) {
appTransformer.transform(t)
}

appTransformer.transform(t)
}
}
}

0 comments on commit fb74cd4

Please sign in to comment.