Like #521, flow typing needs to account for conditional execution (mainly if/else statements).
def m1(def x) {
if (x instanceof CharSequence) {
x = Integer.valueOf(x) // typeof(x) == Integer
}
x // typeof(x) == LUB(Object,Integer)
}
def m1(def x) {
if (predicate()) {
x = ''
} else {
x = new StringBuffer()
}
x // typeof(x) == LUB(String,StringBuffer)
}
Like #521, flow typing needs to account for conditional execution (mainly if/else statements).