mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Allow rest parameter type to be a readonly array or tuple
This commit is contained in:
@@ -23180,7 +23180,7 @@ namespace ts {
|
||||
|
||||
// Only check rest parameter type if it's not a binding pattern. Since binding patterns are
|
||||
// not allowed in a rest parameter, we already have an error from checkGrammarParameterList.
|
||||
if (node.dotDotDotToken && !isBindingPattern(node.name) && !isTypeAssignableTo(getTypeOfSymbol(node.symbol), anyArrayType)) {
|
||||
if (node.dotDotDotToken && !isBindingPattern(node.name) && !isTypeAssignableTo(getTypeOfSymbol(node.symbol), anyReadonlyArrayType)) {
|
||||
error(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user