@@ -361,7 +361,7 @@ object StringContextChecker {
361
361
* @param notAllowedFlagsOnCondition a list that maps which flags are allowed depending on the conversion Char
362
362
* @return reports an error if the flag is not allowed, nothing otherwise
363
363
*/
364
- def checkFlags (partIndex : Int , flags : List [(Char , Int )], notAllowedFlagOnCondition : (Char , Boolean , String )* ) = {
364
+ def checkFlags (partIndex : Int , flags : List [(Char , Int )], notAllowedFlagOnCondition : List [ (Char , Boolean , String )] ) = {
365
365
for {flag <- flags ; (nonAllowedFlag, condition, message) <- notAllowedFlagOnCondition ; if (flag._1 == nonAllowedFlag && condition)}
366
366
reporter.partError(message, partIndex, flag._2)
367
367
}
@@ -373,7 +373,7 @@ object StringContextChecker {
373
373
* @param notAllowedFlagsOnCondition a list that maps which flags are allowed depending on the conversion Char
374
374
* @return reports an error only once if at least one of the flags is not allowed, nothing otherwise
375
375
*/
376
- def checkUniqueFlags (partIndex : Int , flags : List [(Char , Int )], notAllowedFlagOnCondition : (Char , Boolean , String )* ) = {
376
+ def checkUniqueFlags (partIndex : Int , flags : List [(Char , Int )], notAllowedFlagOnCondition : List [ (Char , Boolean , String )] ) = {
377
377
reporter.resetReported()
378
378
for {flag <- flags ; (nonAllowedFlag, condition, message) <- notAllowedFlagOnCondition ; if (flag._1 == nonAllowedFlag && condition)} {
379
379
if (! reporter.hasReported())
@@ -394,7 +394,7 @@ object StringContextChecker {
394
394
*/
395
395
def checkCharacterConversion (partIndex : Int , flags : List [(Char , Int )], hasPrecision : Boolean , precisionIndex : Int ) = {
396
396
val notAllowedFlagOnCondition = for (flag <- List ('#' , '+' , ' ' , '0' , ',' , '(' )) yield (flag, true , " Only '-' allowed for c conversion" )
397
- checkUniqueFlags(partIndex, flags, notAllowedFlagOnCondition : _* )
397
+ checkUniqueFlags(partIndex, flags, notAllowedFlagOnCondition)
398
398
checkNotAllowedParameter(hasPrecision, partIndex, precisionIndex, " precision" )
399
399
}
400
400
@@ -413,7 +413,7 @@ object StringContextChecker {
413
413
*/
414
414
def checkIntegralConversion (partIndex : Int , argType : Option [Type ], conversionChar : Char , flags : List [(Char , Int )], hasPrecision : Boolean , precision : Int ) = {
415
415
if (conversionChar == 'd' )
416
- checkFlags(partIndex, flags, ( '#' , true , " # not allowed for d conversion" ))
416
+ checkFlags(partIndex, flags, List (( '#' , true , " # not allowed for d conversion" ) ))
417
417
418
418
checkNotAllowedParameter(hasPrecision, partIndex, precision, " precision" )
419
419
}
@@ -471,7 +471,7 @@ object StringContextChecker {
471
471
}
472
472
473
473
val notAllowedFlagOnCondition = for (flag <- List ('#' , '+' , ' ' , '0' , ',' , '(' )) yield (flag, true , " Only '-' allowed for date/time conversions" )
474
- checkUniqueFlags(partIndex, flags, notAllowedFlagOnCondition : _* )
474
+ checkUniqueFlags(partIndex, flags, notAllowedFlagOnCondition)
475
475
checkNotAllowedParameter(hasPrecision, partIndex, precision, " precision" )
476
476
checkTime(part, partIndex, conversionIndex)
477
477
}
@@ -506,12 +506,12 @@ object StringContextChecker {
506
506
checkNotAllowedParameter(hasPrecision, partIndex, precision, " precision" )
507
507
checkNotAllowedParameter(hasWidth, partIndex, width, " width" )
508
508
val notAllowedFlagOnCondition = for (flag <- List ('-' , '#' , '+' , ' ' , '0' , ',' , '(' )) yield (flag, true , " flags not allowed" )
509
- checkUniqueFlags(partIndex, flags, notAllowedFlagOnCondition : _* )
509
+ checkUniqueFlags(partIndex, flags, notAllowedFlagOnCondition)
510
510
}
511
511
case '%' => {
512
512
checkNotAllowedParameter(hasPrecision, partIndex, precision, " precision" )
513
513
val notAllowedFlagOnCondition = for (flag <- List ('#' , '+' , ' ' , '0' , ',' , '(' )) yield (flag, true , " Illegal flag '" + flag + " '" )
514
- checkFlags(partIndex, flags, notAllowedFlagOnCondition : _* )
514
+ checkFlags(partIndex, flags, notAllowedFlagOnCondition)
515
515
}
516
516
case _ => // OK
517
517
}
@@ -600,7 +600,7 @@ object StringContextChecker {
600
600
(' ' , ! (argType <:< defn.JavaBigIntegerClass .typeRef), " only use ' ' for BigInt conversions to o, x, X" ),
601
601
('(' , ! (argType <:< defn.JavaBigIntegerClass .typeRef), " only use '(' for BigInt conversions to o, x, X" ),
602
602
(',' , true , " ',' only allowed for d conversion of integral types" ))
603
- checkFlags(partIndex, flags, notAllowedFlagOnCondition : _* )
603
+ checkFlags(partIndex, flags, notAllowedFlagOnCondition)
604
604
}
605
605
}
606
606
case 'e' | 'E' | 'f' | 'g' | 'G' | 'a' | 'A' => checkSubtype(argType, " Double" , argIndex, floatingPoints)
@@ -631,7 +631,7 @@ object StringContextChecker {
631
631
(' ' , true , " only use ' ' for BigInt conversions to o, x, X" ),
632
632
('(' , true , " only use '(' for BigInt conversions to o, x, X" ),
633
633
(',' , true , " ',' only allowed for d conversion of integral types" ))
634
- checkFlags(partIndex, flags, notAllowedFlagOnCondition : _* )
634
+ checkFlags(partIndex, flags, notAllowedFlagOnCondition)
635
635
}
636
636
case _ => // OK
637
637
}
0 commit comments