Type-checking is just one static verification tool. Arity, numeric overflow, array bounds and null errors can also be verified statically.
Related Posts
Really cute approach to reporting type errors: when there's a type error, show an example of a runtime error that the type check has prevented!
Data-Driven Techniques for Type Error Diagnosis https://escholarship.org/uc/item/59s4h4pv
I'm working on arity errors in Garden, my toy programming language.
Rather than just saying "expected 3, got 4 arguments", I'm trying to report where the extra argument is, or what extra argument was expected.
I'm having fun writing a simple type checker, but I'm learning firsthand why syntax-directed checking doesn't work. It prevents inference.
My checker catches real bugs, but it can't handle cases like this:
[1, 2].map(fun(x) { x + 1; })
I think I need bidirectional checking.