Merge pull request #3612 from dwijnand/scope-toString

Handle Global in Scope#toString
This commit is contained in:
eugene yokota 2017-10-05 17:43:25 -04:00 committed by GitHub
commit 1251817cf2
1 changed files with 4 additions and 3 deletions

View File

@ -29,9 +29,10 @@ final case class Scope(project: ScopeAxis[Reference],
def in(config: ConfigKey): Scope = copy(config = Select(config))
def in(task: AttributeKey[_]): Scope = copy(task = Select(task))
override def toString: String = {
if (extra == This) s"$project / $config / $task"
else s"Scope($project, $config, $task, $extra)"
override def toString: String = this match {
case Scope(Zero, Zero, Zero, Zero) => "Global"
case Scope(_, _, _, This) => s"$project / $config / $task"
case _ => s"Scope($project, $config, $task, $extra)"
}
}
object Scope {