Microsoft/TypeScript — pull request #610 by ahejlsberg (2014-09-05 20:07:14+00:00)
Title: Circular function expressions

Fixes #445 and #583.

Function expression bodies are now checked in a separate phase after all statements in the enclosing body to ensure constructs like the following are correctly typed:
```typescript
var foo = function () {
var s = foo();
return "hello";
}
```
Previously we'd perform a full type check of the body of the function expression whilst in the process determining the type of `foo` which would cause `foo` to be given type `any` because of the recursive reference. With this change, `foo` is now correctly typed as `() => string`.