groovy/groovy-core — pull request #565 by melix (2014-12-26 11:02:34+00:00)
Title: GROOVY-1628: Final variable inference

This PR should not be merged as is because work is incomplete. It is intended to start the discussion. The idea is to have a visitor which performs final variable inference. That is to say that it is not only capable of checking that a final variable should not be reassigned, but also that a variable is effectively final.

The latter is important for bytecode and performance optimizations (like not wrapping closure shared variables in case they can be passed directly).