Consider the following:
File findFile(boolean condition) {
def file
if (condition) {
file = new File(System.getProperty('user.home'), '.groovy')
} else {
file = new File(System.getProperty('groovy.root'))
}
file.canonicalFile
}
The last occurrence of "file" is showing as unknown (underlined). Since the variable is initialized to a java.io.File in both conditional branches, the type should propagate to the outer block.

Consider the following:
The last occurrence of "file" is showing as unknown (underlined). Since the variable is initialized to a java.io.File in both conditional branches, the type should propagate to the outer block.