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
//! Node: `cxx:Function:Luau.Analysis:Analysis/src/ToString.cpp:1847:dump`
//! Source: `Analysis/src/ToString.cpp:1847-1854` (hand-ported)

use crate::type_aliases::type_id::TypeId;
use alloc::string::{String, ToString};

/// C++ `std::string dump(const std::optional<TypeId>& ty)`.
pub fn dump_optional_type_id(ty: &Option<TypeId>) -> String {
    if let Some(ty) = ty {
        return crate::functions::dump_to_string::dump_type_id(*ty);
    }

    std::println!("nullopt");
    "nullopt".to_string()
}