1
0

Fix list type checking

This commit is contained in:
Jeff 2023-12-16 21:26:07 -05:00
parent 500a579910
commit 70f0c6b887
2 changed files with 5 additions and 2 deletions

View File

@ -84,8 +84,6 @@ impl AbstractTree for Assignment {
} }
} else { } else {
if let Type::List(item_type) = identifier_type { if let Type::List(item_type) = identifier_type {
println!("{item_type} {statement_type}");
item_type item_type
.check(&statement_type) .check(&statement_type)
.map_err(|error| error.at_node(statement_node, source))?; .map_err(|error| error.at_node(statement_node, source))?;

View File

@ -44,6 +44,11 @@ impl AbstractTree for FunctionCall {
} = &function_type } = &function_type
{ {
let expected_type = parameter_types.get(argument_index).unwrap(); 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 expected_type
.check(&expression_type) .check(&expression_type)