You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i"it is not the only argument to be passed to the corresponding repeated parameter $formal"
517
+
else
518
+
i"the corresponding parameter has type $formal which is not a repeated parameter type"
519
+
fail(em"Sequence argument type annotation `*` cannot be used here:\n$addendum", arg)
520
+
512
521
/** Add result of typing argument `arg` against parameter type `formal`.
513
522
* @return The remaining formal parameter types. If the method is parameter-dependent
514
523
* this means substituting the actual argument type for the current formal parameter
515
524
* in the remaining formal parameters.
516
525
*/
517
-
defaddTyped(arg: Arg, formal: Type):List[Type] =
518
-
if!ctx.isAfterTyper && isVarArg(arg) &&!formal.isRepeatedParam then
519
-
fail(i"Sequence argument type annotation `: _*` cannot be used here: the corresponding parameter has type $formal which is not a repeated parameter type", arg)
526
+
defaddTyped(arg: Arg):List[Type] =
527
+
if!formal.isRepeatedParam then checkNoVarArg(arg)
520
528
addArg(typedArg(arg, formal), formal)
521
529
if methodType.isParamDependent && typeOfArg(arg).exists then
522
530
// `typeOfArg(arg)` could be missing because the evaluation of `arg` produced type errors
Copy file name to clipboardExpand all lines: docs/docs/reference/changed-features/vararg-splices.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ title: "Vararg Splices"
6
6
The syntax of vararg splices in patterns and function arguments has changed. The new syntax uses a postfix `*`, analogously to how a vararg parameter is declared.
0 commit comments