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
use crate::records::anyification::Anyification;
use crate::records::free_type_pack::FreeTypePack;
use crate::type_aliases::type_pack_id::TypePackId;

impl Anyification {
    /// `bool Anyification::isDirty(TypePackId tp)` (Anyification.cpp:54-62).
    pub fn is_dirty_type_pack_id(&mut self, tp: TypePackId) -> bool {
        if unsafe { (*tp).persistent } {
            return false;
        }

        // C++: `if (log->getMutable<FreeTypePack>(tp)) return true; else return false;`
        let log = self.base.base.log;
        let ftp = unsafe { (*log).txn_log_get_mutable::<FreeTypePack, TypePackId>(tp) };
        !ftp.is_null()
    }
}