Skip to main content

luaur_analysis/methods/
unifier_2_mk_union.rs

1use crate::functions::follow_type::follow_type_id;
2use crate::functions::simplify_union::simplify_union;
3use crate::records::builtin_types::BuiltinTypes;
4use crate::records::type_arena::TypeArena;
5use crate::records::unifier_2::Unifier2;
6use crate::type_aliases::type_id::TypeId;
7
8impl Unifier2 {
9    pub fn mk_union(&mut self, left: TypeId, right: TypeId) -> TypeId {
10        let left = unsafe { follow_type_id(left) };
11        let right = unsafe { follow_type_id(right) };
12        let builtin_types = self.builtin_types.as_ptr();
13        let arena = self.arena.as_ptr();
14        simplify_union(builtin_types, arena, left, right).result
15    }
16}