diff --git a/main/src/main/scala/sbt/SlashSyntax.scala b/main/src/main/scala/sbt/SlashSyntax.scala index 14d6d476c..634a86b75 100644 --- a/main/src/main/scala/sbt/SlashSyntax.scala +++ b/main/src/main/scala/sbt/SlashSyntax.scala @@ -1,6 +1,7 @@ package sbt import sbt.librarymanagement.Configuration +import sbt.internal.util.AttributeKey /** * SlashSyntax implements the slash syntax to scope keys for build.sbt DSL. @@ -57,7 +58,12 @@ object SlashSyntax { } /** RichConfiguration wraps a configuration to provide the `/` operator for scoping. */ - final class RichConfiguration(protected val scope: Scope) extends RichScopeLike + final class RichConfiguration(protected val scope: Scope) extends RichScopeLike { + + // This is for handling `Zero / Zero / Zero / name`. + def /(taskAxis: ScopeAxis[AttributeKey[_]]): RichScope = + new RichScope(scope.copy(task = taskAxis)) + } /** Both `Scoped.ScopingSetting` and `Scoped` are parents of `SettingKey`, `TaskKey` and * `InputKey`. We'll need both, so this is a convenient type alias. */ diff --git a/sbt/src/sbt-test/project/unified/build.sbt b/sbt/src/sbt-test/project/unified/build.sbt index 935e32855..7f9835fea 100644 --- a/sbt/src/sbt-test/project/unified/build.sbt +++ b/sbt/src/sbt-test/project/unified/build.sbt @@ -10,6 +10,7 @@ lazy val root = (project in file(".")) Compile / console / scalacOptions += "-Ywarn-numeric-widen", projA / Compile / console / scalacOptions += "-feature", Zero / Zero / name := "foo", + Zero / Zero / Zero / name := "foo", libraryDependencies += uTest % Test, testFrameworks += new TestFramework("utest.runner.Framework"),