diff --git a/src/passes/type_checker.rs b/src/passes/type_checker.rs index 04a3aab..a03716b 100644 --- a/src/passes/type_checker.rs +++ b/src/passes/type_checker.rs @@ -148,6 +148,14 @@ impl TypeChecker { .map(|expr| expr.type_(scope)) .collect::, _>>()?; + if symbol.parameters.len() != expr.arguments.len() { + return Err(ParserError::FunctionArguments( + fn_name.clone(), + symbol.parameters.to_owned(), + args_types, + )); + } + for (expr, type_) in expr.arguments.iter().zip(&symbol.parameters) { if let Err(_) = Self::check_assign(type_.to_owned(), expr, scope) { return Err(ParserError::FunctionArguments(