Skip to main content

luaur_analysis/methods/
reference_count_initializer_visit_constraint_alt_h.rs

1use crate::records::free_type_pack::FreeTypePack;
2use crate::records::reference_count_initializer::ReferenceCountInitializer;
3use crate::type_aliases::type_pack_id::TypePackId;
4use luaur_common::macros::luau_assert::LUAU_ASSERT;
5use luaur_common::FFlag;
6
7impl ReferenceCountInitializer {
8    /// C++ `bool ReferenceCountInitializer::visit(TypePackId tp, const FreeTypePack&)`
9    /// (Constraint.cpp:74-82).
10    pub fn visit_type_pack_id_free_type_pack(
11        &mut self,
12        tp: TypePackId,
13        _free_type_pack: &FreeTypePack,
14    ) -> bool {
15        if FFlag::LuauConstraintGraph.get() {
16            LUAU_ASSERT!(self.mutated_type_packs.is_null() == false);
17            unsafe {
18                (*self.mutated_type_packs).insert(tp);
19            }
20        }
21        true
22    }
23}