inferring from usage

Topics: General
Oct 5, 2012 at 9:09 PM
Edited Oct 6, 2012 at 12:34 AM

Could it be possible to infer acceptable types for 'arg' and 'val' below?

function foo(arg:number) {}
function bar(arg) { foo(arg); }
function goo() { var val; foo(val); }

I have been using the "implicitAny" style setting (I stumbled across it while looking for a way to implement it myself) and a significant percentage of the warnings in my existing (~11kloc) codebase would have been handled by these additional cases.