closure static inference