Skip to main content

luaur_analysis/methods/
normalizer_union_tables.rs

1use crate::records::normalizer::Normalizer;
2use crate::records::type_ids::TypeIds;
3use crate::type_aliases::type_id::TypeId;
4
5impl Normalizer {
6    pub fn union_tables(&mut self, heres: &mut TypeIds, theres: &TypeIds) {
7        self.consume_fuel();
8
9        for there in theres.order.iter() {
10            let there = *there;
11            let builtin_types = unsafe { &*self.builtin_types };
12            if there == builtin_types.tableType {
13                heres.clear();
14                heres.insert_type_id(there);
15                return;
16            } else {
17                self.union_tables_with_table(heres, there);
18            }
19        }
20    }
21}