luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::enums::unify_result::UnifyResult;
use crate::records::metatable_type::MetatableType;
use crate::records::unifier_2::Unifier2;

impl Unifier2 {
    pub fn unify_metatable_type_metatable_type(
        &mut self,
        sub_metatable: &MetatableType,
        super_metatable: &MetatableType,
    ) -> UnifyResult {
        let metatable_result =
            self.unify_type_id_type_id(sub_metatable.metatable, super_metatable.metatable);
        if metatable_result != UnifyResult::Ok {
            return metatable_result;
        }
        self.unify_type_id_type_id(sub_metatable.table, super_metatable.table)
    }
}