luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
use crate::enums::unify_result::UnifyResult;
use crate::records::intersection_type::IntersectionType;
use crate::records::unifier_2::Unifier2;
use crate::type_aliases::type_id::TypeId;

impl Unifier2 {
    pub fn unify_type_id_intersection_type(
        &mut self,
        sub_ty: TypeId,
        super_intersection: &IntersectionType,
    ) -> UnifyResult {
        let mut result = UnifyResult::Ok;

        for super_part in super_intersection.parts.iter() {
            result = result & self.unify_type_id_type_id(sub_ty, *super_part);
        }

        result
    }
}