@@ -254,28 +254,26 @@ object Settings:
254254
255255 def setMultivalue (arg : String , args : List [String ]) =
256256 val split = arg.split(" ," ).toList
257- // check whether a value was previously set
258- def checkRedundant (actual : List [String ]) =
259- if changed then
260- var dangers : List [String ] = Nil
261- val current = valueIn(sstate).asInstanceOf [List [String ]]
262- for value <- split if current.contains(value) do
263- dangers :+= s " Setting $name set to $value redundantly "
264- dangers.foldLeft(update(current ++ actual, arg, args))((sum, w) => sum.warn(w))
265- else
266- update(actual, arg, args)
257+ def setOrUpdate (actual : List [String ]) =
258+ val updated =
259+ if changed then
260+ val current = valueIn(sstate).asInstanceOf [List [String ]]
261+ current ++ actual
262+ else
263+ actual
264+ update(updated, arg, args)
267265 choices match
268266 case Some (choices) =>
269267 split.partition(choices.contains) match
270- case (_, Nil ) => checkRedundant (split)
268+ case (_, Nil ) => setOrUpdate (split)
271269 case (valid, invalid) =>
272270 legacyChoices match
273271 case Some (legacyChoices) =>
274272 invalid.filterNot(legacyChoices.contains) match
275- case Nil => checkRedundant (valid) // silently ignore legacy choices
273+ case Nil => setOrUpdate (valid) // silently ignore legacy choices
276274 case invalid => invalidChoices(invalid)
277275 case none => invalidChoices(invalid)
278- case none => checkRedundant (split)
276+ case none => setOrUpdate (split)
279277
280278 def matches : Boolean =
281279 val name = arg.takeWhile(_ != ':' )
0 commit comments