> For a less trivial example, consider the expression "f(x) + g(x)" where both f and g can return either a number or a string. It is conceivable that for any given x, they would always return the same type, but a type system cannot detect every such case.
You can encode this quite easily in a language with a dependent types.
You can encode this quite easily in a language with a dependent types.