mirror of
https://github.com/nushell/nushell.git
synced 2025-07-07 18:07:02 +02:00
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:
@ -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, .. }) => {
|
||||
|
Reference in New Issue
Block a user