Skip to main content

Crate tsz_checker

Crate tsz_checker 

Source
Expand description

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.

Re-exports§

pub use context::CheckerContext;
pub use context::EnclosingClassInfo;
pub use context::TypeCache;
pub use dispatch::ExpressionDispatcher;
pub use expr::ExpressionChecker;
pub use statements::StatementCheckCallbacks;
pub use statements::StatementChecker;

Modules§

accessor_checker
Accessor declaration validation (abstract consistency, setter parameters).
assignability_checker
Type assignability and excess property checking.
assignment_checker
Assignment expression checking (simple, compound, logical, readonly).
call_checker
Call expression checking (overload resolution, contextual typing, signature instantiation).
class_checker
Class/interface declaration checking (inheritance, implements, abstract members).
class_inheritance
Class Inheritance Cycle Detection
class_type
Class instance type resolution (instance members, inheritance, interface merging).
constructor_checker
Constructor type checking (accessibility, signatures, instantiation, mixins).
context
Checker Context
control_flow
Control Flow Analysis for type narrowing.
declarations
Declaration Type Checking
diagnostics
dispatch
Expression type computation dispatcher.
enum_checker
Enum type checking (detection, member types, assignability, const enums).
error_reporter
Error reporting (error_* for emission, report_* for higher-level wrappers). This module is split into focused submodules for maintainability.
expr
Expression Type Checking
flow_analysis
Flow Analysis Module
flow_analyzer
Definite Assignment Analysis for control flow analysis.
flow_graph_builder
Flow Graph Builder for Control Flow Analysis.
function_type
Function, method, and arrow function type resolution.
generic_checker
Generic type argument validation (TS2344 constraint checking).
import_checker
Import/export declaration validation (TS2307, TS2305, TS2309, TS1202).
interface_type
Interface type resolution (heritage merging, structural merge).
iterable_checker
Iterable/iterator protocol checking and for-of element type computation.
jsx_checker
JSX type checking (element types, intrinsic elements, namespace types).
judge_integration
Judge Integration for the Checker
literal_type
Literal Type Utilities Module
module_checker
Module import/export validation and circular re-export detection.
module_resolution
Module resolution utilities for multi-file type checking.
namespace_checker
Namespace type merging and re-export resolution for declaration merging.
object_type
Object Type Utilities Module
optional_chain
Optional Chaining Type Checking
parameter_checker
Function parameter validation (duplicates, ordering, initializers).
private_checker
Private field access and brand checking for nominal class typing.
promise_checker
Promise/async type checking (detection, type argument extraction, return types).
property_checker
Property access checking (accessibility, computed names, const modifiers).
reachability_analyzer
Reachability Analysis for detecting unreachable code.
reachability_checker
Code reachability and fall-through analysis.
scope_finder
Enclosing scope and context traversal (functions, classes, static blocks).
signature_builder
Call/construct signature building (parameter extraction, instantiation, return types).
state
CheckerState - Type Checker Orchestration Layer
state_checking
Declaration and statement checking, including StatementCheckCallbacks.
state_type_analysis
Type analysis: qualified name resolution, symbol type computation, type queries, and contextual literal type analysis.
state_type_environment
Type environment building, application type evaluation, property access type resolution, and type node resolution.
state_type_resolution
Type reference resolution: interfaces, type aliases, and type references on CheckerState.
statements
Statement Type Checking
subtype_identity_checker
Subtype checking, type identity, and redeclaration compatibility.
super_checker
Super expression validation (calls, property access, derived class requirements).
symbol_resolver
Symbol resolution helpers (type resolution, intrinsic detection, identifier lookup).
triple_slash_validator
Triple-slash reference directive validation
type_checking
Type checking validation: utility methods, AST traversal helpers, member/declaration/private identifier/parameter property validation, destructuring, import/return/await/variable/using declaration validation.
type_computation
Type computation helpers, relationship queries, and format utilities. This module extends CheckerState with additional methods for type-related operations, providing cleaner APIs for common patterns.
type_literal_checker
Type literal checking (type resolution, references, and signatures within type literals).
type_node
Type Node Checking

Structs§

AssignmentStateMap
A mapping of variables to their assignment states at a point in the program.
CheckerOptions
Compiler options for type checking.
CheckerState
Type checker state using NodeArena and Solver type system.
ControlFlowGraph
A control flow graph that provides query methods for flow analysis.
DeclarationChecker
Declaration type checker that operates on the shared context.
DefiniteAssignmentAnalyzer
Analyzer that performs definite assignment analysis.
DefiniteAssignmentResult
Definite assignment analysis result for a specific program point.
FlowAnalyzer
Flow analyzer for control flow-based type narrowing.
FlowGraph
A control flow graph side-table.
FlowGraphBuilder
Builder for constructing a FlowGraph from Node AST.
ReachabilityAnalyzer
Analyzer for detecting unreachable code.
TypeNodeChecker
Type node checker that operates on the shared context.

Enums§

AssignmentState
Assignment state for a single variable at a point in the control flow.
Visibility
Visibility modifier for class properties

Constants§

MAX_CALL_DEPTH
Maximum depth for function call resolution.
MAX_INSTANTIATION_DEPTH
Maximum depth for generic type instantiation.

Functions§

merge_assignment_states
Merges multiple assignment state maps at a control flow join point.