JS:
in this case x and y's type is inferred from future use. The compiler essentially just lazily infers the variable type. Obviously ambiguity will generate an error.
Do you mean the flow-sensitive typing of the Whiley language? http://whiley.org/guide/typing/flow-typing/ It's surely neat. But it needs flow analysis. Bye, bearophile