luaur-analysis 0.1.0

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::functions::get_type_alt_j::get_type_id;
use crate::records::blocked_type::BlockedType;
use crate::records::free_type::FreeType;
use crate::records::generic_type::GenericType;
use crate::records::pending_expansion_type::PendingExpansionType;
use crate::records::type_function_instance_type::TypeFunctionInstanceType;
use crate::type_aliases::type_id::TypeId;

pub fn is_plain_tyvar(ty: TypeId) -> bool {
    unsafe {
        !get_type_id::<FreeType>(ty).is_null()
            || !get_type_id::<GenericType>(ty).is_null()
            || !get_type_id::<BlockedType>(ty).is_null()
            || !get_type_id::<PendingExpansionType>(ty).is_null()
            || !get_type_id::<TypeFunctionInstanceType>(ty).is_null()
    }
}