Skip to content

Commit e581649

Browse files
committed
Allow rest parameter type to be a readonly array or tuple
1 parent d24a63d commit e581649

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23180,7 +23180,7 @@ namespace ts {
2318023180

2318123181
// Only check rest parameter type if it's not a binding pattern. Since binding patterns are
2318223182
// not allowed in a rest parameter, we already have an error from checkGrammarParameterList.
23183-
if (node.dotDotDotToken && !isBindingPattern(node.name) && !isTypeAssignableTo(getTypeOfSymbol(node.symbol), anyArrayType)) {
23183+
if (node.dotDotDotToken && !isBindingPattern(node.name) && !isTypeAssignableTo(getTypeOfSymbol(node.symbol), anyReadonlyArrayType)) {
2318423184
error(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type);
2318523185
}
2318623186
}

0 commit comments

Comments
 (0)