tsz-checker 0.1.9

TypeScript type checker for the tsz compiler
Documentation
//! Type checker module for TypeScript AST.
//!
//! This module is organized into several submodules:
//! - `context` - `CheckerContext` for shared state
//! - `expr` - Expression type checking
//! - `statements` - Statement type checking
//! - `declarations` - Declaration type checking
//! - `flow_graph_builder` - Control flow graph builder
//! - `flow_analyzer` - Definite assignment analysis
//! - `reachability_analyzer` - Unreachable code detection
//! - `control_flow` - Flow analyzer for type narrowing
//! - `error_reporter` - Error reporting utilities
//!
//! Note: The thin checker is the unified checker pipeline; `CheckerState`
//! is an alias to the thin checker.

extern crate self as tsz_checker;

pub mod context;
pub mod dispatch;
pub mod error_reporter;
pub mod expr;
pub mod judge_integration;
pub mod module_resolution;
pub mod optional_chain;
mod query_boundaries;
pub mod statements;
pub mod triple_slash_validator;

#[path = "assignability/mod.rs"]
mod assignability_domain;
#[path = "checkers/mod.rs"]
mod checkers_domain;
#[path = "classes/mod.rs"]
mod classes_domain;
#[path = "declarations/mod.rs"]
mod declarations_domain;
#[path = "flow/mod.rs"]
mod flow_domain;
#[path = "state/mod.rs"]
mod state_domain;
#[path = "symbols/mod.rs"]
mod symbols_domain;
#[path = "types/mod.rs"]
mod types_domain;

pub use checkers_domain::{
    accessor_checker, call_checker, enum_checker, generic_checker, iterable_checker, jsx_checker,
    parameter_checker, promise_checker, property_checker, signature_builder,
};

pub use assignability_domain::{
    assignability_checker, assignment_checker, subtype_identity_checker,
};

pub use classes_domain::{
    class_checker, class_inheritance, constructor_checker, private_checker, super_checker,
};

pub use declarations_domain::{declarations, import_checker, module_checker, namespace_checker};

pub use flow_domain::{
    control_flow, flow_analysis, flow_analyzer, flow_graph_builder, reachability_analyzer,
    reachability_checker,
};

pub use state_domain::{
    state, state_checking, state_type_analysis, state_type_environment, state_type_resolution,
};

pub use symbols_domain::{scope_finder, symbol_resolver};

pub use types_domain::{
    class_type, function_type, interface_type, literal_type, object_type, type_checking,
    type_computation, type_literal_checker, type_node,
};

pub mod diagnostics {
    pub use tsz_common::diagnostics::{
        Diagnostic, DiagnosticCategory, DiagnosticRelatedInformation, diagnostic_codes,
        diagnostic_messages, format_message,
    };
}

// Tests that don't depend on root crate's test_fixtures
#[cfg(test)]
#[path = "../tests/conformance_issues.rs"]
mod conformance_issues;
#[cfg(test)]
#[path = "../tests/control_flow_tests.rs"]
mod control_flow_tests;
#[cfg(test)]
#[path = "../tests/control_flow_type_guard_tests.rs"]
mod control_flow_type_guard_tests;
#[cfg(test)]
#[path = "../tests/definite_assignment_tests.rs"]
mod definite_assignment_tests;
#[cfg(test)]
#[path = "../tests/enum_member_cache_tests.rs"]
mod enum_member_cache_tests;
#[cfg(test)]
#[path = "../tests/enum_merge_tests.rs"]
mod enum_merge_tests;
#[cfg(test)]
#[path = "../tests/no_filename_based_behavior_tests.rs"]
mod no_filename_based_behavior_tests;
#[cfg(test)]
#[path = "../tests/rest_parameter_tests.rs"]
mod rest_parameter_tests;
#[cfg(test)]
#[path = "../tests/spread_rest_tests.rs"]
mod spread_rest_tests;
#[cfg(test)]
#[path = "../tests/stability_validation_tests.rs"]
mod stability_validation_tests;
#[cfg(test)]
#[path = "../tests/string_literal_arithmetic_tests.rs"]
mod string_literal_arithmetic_tests;
#[cfg(test)]
#[path = "../tests/symbol_resolver_stability_tests.rs"]
mod symbol_resolver_stability_tests;
#[cfg(test)]
#[path = "../tests/ts1214_let_strict_mode_tests.rs"]
mod ts1214_let_strict_mode_tests;
#[cfg(test)]
#[path = "../tests/ts2300_tests.rs"]
mod ts2300_tests;
#[cfg(test)]
#[path = "../tests/ts2322_mode_routing_matrix.rs"]
mod ts2322_mode_routing_matrix;
#[cfg(test)]
#[path = "../tests/ts2322_tests.rs"]
mod ts2322_tests;
#[cfg(test)]
#[path = "../tests/ts2323_tests.rs"]
mod ts2323_tests;
#[cfg(test)]
#[path = "../tests/ts2411_tests.rs"]
mod ts2411_tests;
#[cfg(test)]
#[path = "../tests/ts2430_tests.rs"]
mod ts2430_tests;
#[cfg(test)]
#[path = "../tests/ts2540_readonly_tests.rs"]
mod ts2540_readonly_tests;
#[cfg(test)]
#[path = "../tests/ts2558_new_type_args_tests.rs"]
mod ts2558_new_type_args_tests;
#[cfg(test)]
#[path = "../tests/ts2774_tests.rs"]
mod ts2774_tests;
#[cfg(test)]
#[path = "../tests/ts6133_unused_type_params_tests.rs"]
mod ts6133_unused_type_params_tests;
#[cfg(test)]
#[path = "../tests/ts7057_yield_implicit_any.rs"]
mod ts7057_yield_implicit_any;
#[cfg(test)]
#[path = "../tests/value_usage_tests.rs"]
mod value_usage_tests;
// Tests kept in root test harness where shared fixtures live.
#[cfg(test)]
#[path = "../tests/architecture_contract_tests.rs"]
mod architecture_contract_tests;
#[cfg(test)]
#[path = "tests/architecture_contract_tests.rs"]
mod architecture_contract_tests_src;
#[cfg(test)]
#[path = "../tests/class_index_signature_compat_tests.rs"]
mod class_index_signature_compat_tests;
#[cfg(test)]
#[path = "../tests/conditional_keyof_test.rs"]
mod conditional_keyof_test;
#[cfg(test)]
#[path = "../tests/enum_nominality_tests.rs"]
mod enum_nominality_tests;
#[cfg(test)]
#[path = "../tests/flow_boundary_contract_tests.rs"]
mod flow_boundary_contract_tests;
#[cfg(test)]
#[path = "../tests/generic_inference_manual.rs"]
mod generic_inference_manual;
#[cfg(test)]
#[path = "../tests/generic_tests.rs"]
mod generic_tests;
#[cfg(test)]
#[path = "../tests/member_access_architecture_boundary_tests.rs"]
mod member_access_architecture_boundary_tests;
#[cfg(test)]
#[path = "../tests/module_resolution_guard_tests.rs"]
mod module_resolution_guard_tests;
#[cfg(test)]
#[path = "../tests/private_brands.rs"]
mod private_brands;
#[cfg(test)]
#[path = "../tests/repro_parserreal.rs"]
mod repro_parserreal;
#[cfg(test)]
#[path = "../tests/strict_null_manual.rs"]
mod strict_null_manual;

// Re-export key types
pub use context::{CheckerContext, CheckerOptions, EnclosingClassInfo, TypeCache};
pub use control_flow::{FlowAnalyzer, FlowGraph as ControlFlowGraph};
pub use declarations::DeclarationChecker;
pub use dispatch::ExpressionDispatcher;
pub use expr::ExpressionChecker;
pub use flow_analyzer::{
    AssignmentState, AssignmentStateMap, DefiniteAssignmentAnalyzer, DefiniteAssignmentResult,
    merge_assignment_states,
};
pub use flow_graph_builder::{FlowGraph, FlowGraphBuilder};
pub use reachability_analyzer::ReachabilityAnalyzer;
pub use state::{CheckerState, MAX_CALL_DEPTH, MAX_INSTANTIATION_DEPTH};
pub use statements::{StatementCheckCallbacks, StatementChecker};
pub use tsz_solver::Visibility;
pub use type_node::TypeNodeChecker;