mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
set up GetTagId
This commit is contained in:
parent
f08c764cad
commit
342d1f34c2
6 changed files with 136 additions and 5 deletions
|
@ -580,6 +580,19 @@ impl<'a> BorrowInfState<'a> {
|
|||
Call(call) => self.collect_call(z, call),
|
||||
|
||||
Literal(_) | RuntimeErrorFunction(_) => {}
|
||||
|
||||
GetTagId { structure: x, .. } => {
|
||||
// if the structure (record/tag/array) is owned, the extracted value is
|
||||
if self.is_owned(*x) {
|
||||
self.own_var(z);
|
||||
}
|
||||
|
||||
// if the extracted value is owned, the structure must be too
|
||||
if self.is_owned(z) {
|
||||
self.own_var(*x);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue