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::generic_type_pack::GenericTypePack;
use crate::records::txn_log::TxnLog;
use crate::records::variadic_type_pack::VariadicTypePack;
use crate::type_aliases::type_pack_id::TypePackId;

pub fn is_variadic_tail(tp: TypePackId, log: &TxnLog, include_hidden_variadics: bool) -> bool {
    if log.txn_log_is::<GenericTypePack, TypePackId>(tp) {
        return true;
    }

    if let Some(vtp) = unsafe { log.txn_log_get::<VariadicTypePack, TypePackId>(tp).as_ref() } {
        if include_hidden_variadics || !vtp.hidden {
            return true;
        }
    }

    false
}