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
18
use crate::records::extern_type::ExternType;
use crate::records::union_type::UnionType;
use crate::records::widen::Widen;
use crate::type_aliases::type_id::TypeId;

use crate::functions::get_type_alt_j::get_type_id;

impl Widen {
    pub fn widen_ignore_children(&self, ty: TypeId) -> bool {
        let et = unsafe { get_type_id::<ExternType>(ty) };
        if !et.is_null() {
            return true;
        }

        let ut = unsafe { get_type_id::<UnionType>(ty) };
        ut.is_null()
    }
}