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
17
use crate::functions::get_type_alt_j::get_type_id;
use crate::records::function_type::FunctionType;
use crate::records::normalized_function_type::NormalizedFunctionType;
use crate::type_aliases::error_type::ErrorType;

/// C++ `static bool areNormalizedFunctions(const NormalizedFunctionType& tys)`.
pub fn are_normalized_functions(tys: &NormalizedFunctionType) -> bool {
    for &ty in &tys.parts.order {
        unsafe {
            if get_type_id::<FunctionType>(ty).is_null() && get_type_id::<ErrorType>(ty).is_null() {
                return false;
            }
        }
    }

    true
}