You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flow typing support is very basic at the moment. As the inference engine moves through the statements of a block, variable assignments overwrite the inferred type of the assigned variable. This does not consider conditional paths like nested closure blocks or blocks that return/throw.
defm1(defx) {
def cl = { ->
x =1
}
x // type remains Object because Closure is not executed
}
defm2(defx) {
if (predicate()) {
x =1return0
}
x // type remains Object because conditional block does not share path here
}
defm3(defx) {
if (x instanceofCharSequence) {
x =Integer.valueOf(x)
}
x // bug prevents assignment within instanceof guard from propagating type info
}
The text was updated successfully, but these errors were encountered:
Flow typing support is very basic at the moment. As the inference engine moves through the statements of a block, variable assignments overwrite the inferred type of the assigned variable. This does not consider conditional paths like nested closure blocks or blocks that return/throw.
The text was updated successfully, but these errors were encountered: