fix: Fixes removeN operator --=

**Problem**
removeN operator doesn't work with settings because the param isn't inlined.

**Solution**
Fix it.
This commit is contained in:
Eugene Yokota 2025-09-03 05:10:53 -04:00
parent a8ce3a8cf6
commit e0013078b5
2 changed files with 13 additions and 2 deletions

View File

@ -184,14 +184,14 @@ sealed abstract class TaskKey[A1]
inline def <++=[A2](vs: Initialize[Task[A2]]): Setting[Task[A1]] =
${ TaskMacro.fakeAppendNImpl }
final inline def -=[A2](v: A2)(using Remove.Value[A1, A2]): Setting[Task[A1]] =
final inline def -=[A2](inline v: A2)(using Remove.Value[A1, A2]): Setting[Task[A1]] =
remove1[A2](taskMacro[A2](v))
final inline def remove1[A2](v: Initialize[Task[A2]])(using
ev: Remove.Value[A1, A2]
): Setting[Task[A1]] = make(v)(ev.removeValue)
final inline def --=[A2](vs: A2)(using r: Remove.Values[A1, A2]): Setting[Task[A1]] =
final inline def --=[A2](inline vs: A2)(using r: Remove.Values[A1, A2]): Setting[Task[A1]] =
removeN[A2](taskMacro[A2](vs))
final inline def removeN[A2](vs: Initialize[Task[A2]])(using

View File

@ -4,6 +4,13 @@ val intsFromScalaV = settingKey[Seq[Int]]("a seq of ints from scalaVersion")
val intsSetSetting = settingKey[Set[Int]]("A set of ints setting")
val stringIntMapSetting = settingKey[Map[String, Int]]("A map of string to int setting")
lazy val intSetting2 = Def.setting {
3
}
lazy val intsSetting2 = Def.setting {
Seq(1, 2, 3)
}
scalaVersion := "3.7.2"
intsTask := Seq(1, 2, 3, 4, 5, 6, 7)
@ -11,12 +18,16 @@ intsTask -= 3
intsTask --= Seq(1, 2)
intsTask -= Option(6)
intsTask --= Option(7)
intsTask -= intSetting2.value
intsTask --= intsSetting2.value
intsSetting := Seq(1, 2, 3, 4, 5, 6, 7)
intsSetting -= 3
intsSetting --= Seq(1, 2)
intsSetting -= Option(6)
intsSetting --= Option(7)
intsSetting -= intSetting2.value
intsSetting --= intsSetting2.value
intsFromScalaV := Seq(1, 2, 3, 4, 5, 6, 7)
intsFromScalaV -= { if scalaVersion.value == "3.7.2" then 3 else 5 }