mirror of https://github.com/sbt/sbt.git
Fixes Zero / Zero / Zero / name handling
Prior to this change `Zero / Zero / Zero / name` broke as folllows:
```
scala> Zero / Zero / Zero / name
Zero / Zero / Zero / name
<console>:18: error: inferred type arguments [sbt.Zero.type] do not conform to method /'s type parameter bounds [K <: sbt.SlashSyntax.Key[K]]
Zero / Zero / Zero / name
^
```
This commit is contained in:
parent
dd9b2b2f3a
commit
53bbb99617
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue