try to handle unknown args

This commit is contained in:
Devyn Cairns 2024-07-04 17:18:42 -07:00
parent c92de3a242
commit 2590f609ce
No known key found for this signature in database

View File

@ -117,14 +117,12 @@ pub(crate) fn compile_call(
.transpose()?; .transpose()?;
match arg { match arg {
Argument::Positional(_) => compiled_args.push(CompiledArg::Positional( Argument::Positional(_) | Argument::Unknown(_) => compiled_args.push(
arg_reg.expect("expr() None in non-Named"), CompiledArg::Positional(arg_reg.expect("expr() None in non-Named"), arg.span()),
arg.span(), ),
)),
Argument::Named((name, _, _)) => { Argument::Named((name, _, _)) => {
compiled_args.push(CompiledArg::Named(name.item.as_str(), arg_reg, arg.span())) compiled_args.push(CompiledArg::Named(name.item.as_str(), arg_reg, arg.span()))
} }
Argument::Unknown(_) => return Err(CompileError::Garbage { span: arg.span() }),
Argument::Spread(_) => compiled_args.push(CompiledArg::Spread( Argument::Spread(_) => compiled_args.push(CompiledArg::Spread(
arg_reg.expect("expr() None in non-Named"), arg_reg.expect("expr() None in non-Named"),
arg.span(), arg.span(),