Local type inference like yours is how TypeScript infers types for 'const x = ...', how Rust decides the type of let bindings, and how C++ resolves auto — none of these languages make you annotate expressions. Hindley-Milner, the full version of this idea, powers OCaml and Haskell, and understanding the bottom-up propagation you implement here is the doorway to it.