From 70f0c6b887bb37594d910e3f349fda51ecac5471 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 16 Dec 2023 21:26:07 -0500 Subject: [PATCH] Fix list type checking --- src/abstract_tree/assignment.rs | 2 -- src/abstract_tree/function_call.rs | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/abstract_tree/assignment.rs b/src/abstract_tree/assignment.rs index fe03cb2..3153d8b 100644 --- a/src/abstract_tree/assignment.rs +++ b/src/abstract_tree/assignment.rs @@ -84,8 +84,6 @@ impl AbstractTree for Assignment { } } else { if let Type::List(item_type) = identifier_type { - println!("{item_type} {statement_type}"); - item_type .check(&statement_type) .map_err(|error| error.at_node(statement_node, source))?; diff --git a/src/abstract_tree/function_call.rs b/src/abstract_tree/function_call.rs index fbb322b..80a188c 100644 --- a/src/abstract_tree/function_call.rs +++ b/src/abstract_tree/function_call.rs @@ -44,6 +44,11 @@ impl AbstractTree for FunctionCall { } = &function_type { let expected_type = parameter_types.get(argument_index).unwrap(); + let expected_type = if let Type::List(item_type) = expected_type { + item_type + } else { + expected_type + }; expected_type .check(&expression_type)