Skip to content

Commit 5ffb211

Browse files
committed
Correct invalid-bounds message on variadic entries
1 parent 330b70d commit 5ffb211

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • crates/transpiler/src/target

crates/transpiler/src/target/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,9 +1517,13 @@ impl Target {
15171517
bounds: &[Option<[f64; 2]>],
15181518
) -> Result<(), TargetError> {
15191519
let num_bounds = bounds.len();
1520-
let operation = self.operation_from_name(name);
1520+
let Some(operation) = self.operation_from_name(name) else {
1521+
return Err(TargetError::InvalidKey(format!(
1522+
"{name} is not an instruction in the target."
1523+
)));
1524+
};
15211525
let num_params = match operation {
1522-
Some(TargetOperation::Normal(op)) => {
1526+
TargetOperation::Normal(op) => {
15231527
let params = op.params_view();
15241528
if params
15251529
.iter()
@@ -1532,11 +1536,7 @@ impl Target {
15321536
}
15331537
params.len()
15341538
}
1535-
_ => {
1536-
return Err(TargetError::InvalidKey(format!(
1537-
"{name} is not an instruction in the target."
1538-
)));
1539-
}
1539+
TargetOperation::Variadic(_) => 0,
15401540
};
15411541
if num_bounds != num_params {
15421542
return Err(TargetError::InvalidKey(format!(

0 commit comments

Comments
 (0)