luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
use crate::records::free_type_pack::FreeTypePack;
use crate::records::reference_count_initializer::ReferenceCountInitializer;
use crate::type_aliases::type_pack_id::TypePackId;
use luaur_common::macros::luau_assert::LUAU_ASSERT;
use luaur_common::FFlag;

impl ReferenceCountInitializer {
    /// C++ `bool ReferenceCountInitializer::visit(TypePackId tp, const FreeTypePack&)`
    /// (Constraint.cpp:74-82).
    pub fn visit_type_pack_id_free_type_pack(
        &mut self,
        tp: TypePackId,
        _free_type_pack: &FreeTypePack,
    ) -> bool {
        if FFlag::LuauConstraintGraph.get() {
            LUAU_ASSERT!(self.mutated_type_packs.is_null() == false);
            unsafe {
                (*self.mutated_type_packs).insert(tp);
            }
        }
        true
    }
}