Compiler: avoid two error message when trying to call a non-existing function

This commit is contained in:
Olivier Goffart 2024-01-24 18:02:02 +01:00
parent 93142bf417
commit 2564eede9f
2 changed files with 15 additions and 0 deletions

View file

@ -891,6 +891,10 @@ impl Expression {
.collect()
}
}
Type::Invalid => {
debug_assert!(ctx.diag.has_error());
arguments.into_iter().map(|x| x.0).collect()
}
_ => {
ctx.diag.push_error("The expression is not a function".into(), &node);
arguments.into_iter().map(|x| x.0).collect()