1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Type System - Constraint-based type inference with subtyping support
//!
//! This module implements a constraint-based type inference system using:
//! - **Subtyping constraints** (T1 <: T2) instead of pure unification
//! - **Bidirectional type checking** (synthesis ⇒ and checking ⇐)
//! - **SSA form** for flow-sensitive analysis
//! - **Worklist solver** for transitive closure
//!
//! # DEPYLER-0499: TypeEnvironment with Subtyping Constraints
//!
//! Replaces 7 fragmented HashMaps with unified TypeEnvironment.
//!
//! # DEPYLER-0202: Constraint Collection and HM Solver Integration
//!
//! The ConstraintCollector walks HIR and generates type equations for the
//! Hindley-Milner solver, enabling automatic type inference for unannotated
//! parameters and return types.
//!
//! # Architecture
//!
//! - **TypeEnvironment**: Single source of truth (O(1) lookups)
//! - **SubtypeChecker**: Implements T1 <: T2 relation
//! - **WorklistSolver**: Constraint solving with transitive closure
//! - **TypeConstraint**: Supports equality and subtyping constraints
//! - **ConstraintCollector**: HIR→Constraints bridge (DEPYLER-0202)
//!
//! # References
//!
//! - Damas-Milner type system (1982) - Hindley-Milner unification
//! - Dunfield & Krishnaswami (2013) - Bidirectional typechecking
//! - Cytron et al. (1991) - SSA form
//! - Pierce (2002) - Types and Programming Languages (Subtyping)
// DEPYLER-0499: New subtyping-aware modules
// DEPYLER-0202: Constraint collection for HM solver integration
// DEPYLER-0950: Inter-procedural type unification
// Legacy Hindley-Milner (kept for backward compatibility)
// Re-exports
pub use ;
pub use ConstraintCollector;
pub use ;
pub use SubtypeChecker;
pub use ;
// Legacy exports
pub use ;
// DEPYLER-0950 exports
pub use ;