Documentation for closure shared variables and advanced type inference