diff --git a/src/lib/node/call.rs b/src/lib/node/call.rs index 0822f2a..b919882 100644 --- a/src/lib/node/call.rs +++ b/src/lib/node/call.rs @@ -24,7 +24,11 @@ impl Node for Call { }; let arguments = if let NodeEnum::Set(set) = self.arguments.as_ref() { - set.get_values() + let mut arguments = vec![]; + for value in set.get_values().iter() { + arguments.push(value.evaluate(env)?); + } + arguments } else { panic!( "This shoulnd not be possible, but call constructed with arguments of type that is not set" @@ -44,7 +48,7 @@ impl Node for Call { // Call function body with arguments match func.get_body() { // Pass arguments to native function - FunctionType::Native(_name, native_function) => native_function(arguments), + FunctionType::Native(_name, native_function) => native_function(&arguments), FunctionType::UserFunction(node_enum) => { // TODO: Push scope // Define variables