add ListLiteralElement

This commit is contained in:
Folkert 2021-09-05 16:36:18 +02:00
parent 82924d70e9
commit 8e7aef314a
7 changed files with 103 additions and 36 deletions

View file

@ -740,7 +740,15 @@ impl<'a> BorrowInfState<'a> {
use Expr::*;
match e {
Tag { arguments: xs, .. } | Struct(xs) | Array { elems: xs, .. } => {
Array { elems: xs, .. } => {
let xs = Vec::from_iter_in(xs.iter().filter_map(|e| e.to_symbol()), self.arena);
self.own_var(z);
// if the used symbol is an argument to the current function,
// the function must take it as an owned parameter
self.own_args_if_param(&xs);
}
Tag { arguments: xs, .. } | Struct(xs) => {
self.own_var(z);
// if the used symbol is an argument to the current function,