@@ -71,7 +71,9 @@ object Settings:
71
71
depends : List [(Setting [? ], Any )] = Nil ,
72
72
ignoreInvalidArgs : Boolean = false ,
73
73
propertyClass : Option [Class [? ]] = None ,
74
- deprecationMsg : Option [String ] = None )(private [Settings ] val idx : Int ) {
74
+ deprecationMsg : Option [String ] = None ,
75
+ // kept only for -Ykind-projector option compatibility
76
+ legacyArgs : Boolean = false )(private [Settings ] val idx : Int ) {
75
77
76
78
77
79
assert(name.startsWith(s " - $category" ), s " Setting $name does not start with category - $category" )
@@ -188,7 +190,7 @@ object Settings:
188
190
case (OptionTag , _) =>
189
191
update(Some (propertyClass.get.getConstructor().newInstance()), args)
190
192
case (ct, args) =>
191
- val argInArgRest = ! argRest.isEmpty
193
+ val argInArgRest = ! argRest.isEmpty || (legacyArgs && choices.exists(_.contains( " " )))
192
194
val argAfterParam = ! argInArgRest && args.nonEmpty && (ct == IntTag || ! args.head.startsWith(" -" ))
193
195
if argInArgRest then
194
196
doSetArg(argRest, args)
@@ -336,6 +338,10 @@ object Settings:
336
338
def ChoiceSetting (category : String , name : String , helpArg : String , descr : String , choices : List [String ], default : String , aliases : List [String ] = Nil ): Setting [String ] =
337
339
publish(Setting (category, validateAndPrependName(name), descr, default, helpArg, Some (choices), aliases = aliases.map(validateSetting)))
338
340
341
+ // Allows only args after :, but supports empty string as a choice. Used for -Ykind-projector
342
+ def LegacyChoiceSetting (category : String , name : String , helpArg : String , descr : String , choices : List [String ], default : String , aliases : List [String ] = Nil ): Setting [String ] =
343
+ publish(Setting (category, validateAndPrependName(name), descr, default, helpArg, Some (choices), aliases = aliases.map(validateSetting), legacyArgs = true ))
344
+
339
345
def MultiChoiceSetting (category : String , name : String , helpArg : String , descr : String , choices : List [String ], default : List [String ], aliases : List [String ] = Nil ): Setting [List [String ]] =
340
346
publish(Setting (category, validateAndPrependName(name), descr, default, helpArg, Some (choices), aliases = aliases.map(validateSetting)))
341
347
0 commit comments