Fix list type checking
This commit is contained in:
parent
500a579910
commit
70f0c6b887
@ -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))?;
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user