Skip to content

Commit

Permalink
Fix bug in function call
Browse files Browse the repository at this point in the history
  • Loading branch information
danhper committed Jul 24, 2024
1 parent 64bece3 commit f1a8314
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/interpreter/functions/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ impl Function {
}

let valid_args = self.def.get_valid_args(&self.receiver);
let potential_types = valid_args.iter().filter(|a| a.len() == args.len());
let potential_types = valid_args
.iter()
.filter(|a| a.len() == args.len())
.collect_vec();

for (i, arg_types) in potential_types.enumerate() {
for (i, arg_types) in potential_types.iter().enumerate() {
let res = self._unify_types(args, arg_types.as_slice());
if res.is_ok() || i == valid_args_lengths.len() - 1 {
if res.is_ok() || i == potential_types.len() - 1 {
return res;
}
}
Expand Down

0 comments on commit f1a8314

Please sign in to comment.