luaur-analysis 0.1.1

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::records::subtyping_environment::SubtypingEnvironment;
use crate::type_aliases::lookup_result::LookupResult;
use crate::type_aliases::type_pack_id::TypePackId;

impl SubtypingEnvironment {
    pub fn lookup_generic_pack(&self, tp: TypePackId) -> LookupResult {
        let result = self.mapped_generic_packs.lookup_generic_pack(tp);
        if result.get_if::<TypePackId>().is_some() {
            result
        } else if !self.parent.is_null() {
            unsafe { (*self.parent).lookup_generic_pack(tp) }
        } else {
            result
        }
    }
}