Set the rest variable to the correct type (#9816)

# Description

This fixes the type of `$rest` to be a `List<...>` so that it properly
is checked in function bodies.

fixes https://github.com/nushell/nushell/issues/9809
This commit is contained in:
JT
2023-07-27 06:22:08 +12:00
committed by GitHub
parent 88a890c11f
commit f8d325dbfe
2 changed files with 9 additions and 1 deletions

View File

@ -3695,7 +3695,7 @@ pub fn parse_signature_helper(working_set: &mut StateWorkingSet, span: Span) ->
Arg::RestPositional(PositionalArg {
shape, var_id, ..
}) => {
working_set.set_variable_type(var_id.expect("internal error: all custom parameters must have var_ids"), syntax_shape.to_type());
working_set.set_variable_type(var_id.expect("internal error: all custom parameters must have var_ids"), Type::List(Box::new(syntax_shape.to_type())));
*shape = syntax_shape;
}
Arg::Flag(Flag { arg, var_id, .. }) => {