Skip to main content

luaur_analysis/methods/
unifier_2_mk_intersection.rs

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