Details
Description
The script:
def execute() {
for (def i = 0; i < 4; ++i) { println i }
}
execute()
works exactly as expected. However:
import groovy.transform.CompileStatic @CompileStatic execute() { for (def i = 0; i < 4; ++i) { println i } } execute()
creates an infinite loop in which the value of i is always 0.