Skip to content

Commit 559413b

Browse files
mmahroussfda-odoo
authored andcommitted
[FIX] fix index calculation in get_indexed_arg_in_call
Fix arg index to account for is on instance if it is true
1 parent df1e271 commit 559413b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/src/core/symbols/function_symbol.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ impl FunctionSymbol {
171171
if index > (call.arguments.args.len()-1) as u32 {
172172
call_arg_keyword = call.arguments.keywords.get((index - call.arguments.args.len() as u32) as usize);
173173
}
174-
let mut arg_index = 0;
175-
if is_on_instance.is_some() {
176-
arg_index += 1;
177-
}
174+
let arg_index = if is_on_instance.unwrap_or(false) {
175+
index + 1
176+
} else {
177+
index
178+
};
179+
178180
if let Some(keyword) = call_arg_keyword {
179181
for arg in self.args.iter() {
180182
if arg.symbol.upgrade().unwrap().borrow().name().to_string() == keyword.arg.as_ref().unwrap().id {

0 commit comments

Comments
 (0)