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
use crate::records::type_arena::TypeArena;
use luaur_common::FFlag;

/// C++ `void freeze(TypeArena& arena)` (TypeArena.cpp:138-145). Freezing is a
/// no-op unless `DebugLuauFreezeArena` is set — the underlying `pagedFreeze`
/// asserts the flag, so the guard must be here.
pub fn freeze(arena: &mut TypeArena) {
    if !FFlag::DebugLuauFreezeArena.get() {
        return;
    }

    arena.types.freeze();
    arena.type_packs.freeze();
}