Skip to content

Commit

Permalink
check_function_decl initializes but not consume variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kenarab committed May 22, 2024
1 parent 49be679 commit 412fb0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/concrete_check/src/linearity_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ impl LinearityChecker {
attributes,
span,
} = decl;
let mut errors: Vec<LinearityError> = Vec::new();
let errors: Vec<LinearityError> = Vec::new();
println!("Checking function declaration: {:?}", decl);
let mut params_vec: Vec<(String, String)> = Vec::new();
for param in params {
Expand Down Expand Up @@ -641,6 +641,8 @@ impl LinearityChecker {
params_vec.push((name.clone(), r#type));
}
state_tbl.init(params_vec, depth);
// Only initialize parameters in table. Not consume them
/*
for param in params {
let Param { name, r#type } = param;
match r#type {
Expand Down Expand Up @@ -678,6 +680,7 @@ impl LinearityChecker {
}
}
}
*/
if errors.len() > 0 {
//FIXME replace with Vec<LinearityError>
Err(errors[0].clone())
Expand Down

0 comments on commit 412fb0c

Please sign in to comment.