Abstract: Static compilation
The alternative implementation is not to rely on inferred types, but rather behave exactly like Java does. The main advantage of this is that the user doesn't have 3 distinct method dispatch modes to understand, like in the previous solution (Java, dynamic Groovy, inferred static Groovy). The major drawback is that the semantics of static Groovy are not close to the ones of dynamic Groovy. For this reason, this is not the preferred experimental implementation. If you think this version should be preferred, do not hesitate to send an email to the mailing list so that we can discuss. You can even fork the current implementation to provide your own.
Static compilation is now part of the Groovy 2.0.0 -beta-3, the experimental compiler branch will be merged into master.
Alternatively, using Groovy 2.0.0-beta-2, you can download the attached jar and add it to your classpath to activate the @CompileStatic annotation. Note that you must use groovy.jar (not groovy-all.jar) and the additional jar with the annotation must be first in the classpath, because it overwrites classes from standard Groovy. Currently, the experimental compiler only supports annotations at the method level.release. You can download the latest Groovy 2 releases and test it.
Static compilation is for the moment only supported at the method level (do not try to add it to a class) and supports direct method calls as long as you do not: