Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
better expect
  • Loading branch information
youknowone committed Jan 10, 2026
commit 725f12d48a0315aa67ff496ecf54ca8608afc1c2
17 changes: 9 additions & 8 deletions crates/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6212,16 +6212,17 @@ impl Compiler {
}
emit!(self, Instruction::CallFunctionEx { has_kwargs });
} else if !arguments.keywords.is_empty() {
// No **kwargs in this branch (has_double_star is false),
// so all keywords have arg.is_some()
let mut kwarg_names = vec![];
for keyword in &arguments.keywords {
if let Some(name) = &keyword.arg {
kwarg_names.push(ConstantData::Str {
value: name.as_str().into(),
});
} else {
// This means **kwargs!
panic!("name must be set");
}
let name = keyword
.arg
.as_ref()
.expect("has_double_star is false, so arg must be Some");
kwarg_names.push(ConstantData::Str {
value: name.as_str().into(),
});
self.compile_expression(&keyword.value)?;
}

Expand Down