Fix documentation unit tests for flow typing
Documentation for closure shared variables and advanced type inference