when a whitelisted method has a maxInvocationCount limit, the method call is moved into a closure that is passed to the RuntimeInvocationCountChecker, when this happens the previously inferred type by the static type checker is no longer valid, e.g. the variable reference i in def i = 1; run({'test'+i}) is not of type int but groovy.lang.Reference, therefore static type annotations must be removed to revert back to dynamic type checking
i
indef i = 1; run({'test'+i})
is not of typeint
butgroovy.lang.Reference
, therefore static type annotations must be removed to revert back to dynamic type checking