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
use crate::records::replacer_deprecated::ReplacerDeprecated;
use crate::type_aliases::type_id::TypeId;
use luaur_common::macros::luau_assert::LUAU_ASSERT;

impl ReplacerDeprecated {
    pub fn clean_type_id(&mut self, ty: TypeId) -> TypeId {
        let res = self
            .replacements
            .find(&ty)
            .expect("TypeId not found in replacements");
        LUAU_ASSERT!(!res.is_null());
        let cleaned = *res;
        self.base.dont_traverse_into_type_id(cleaned);
        cleaned
    }
}