S09008

Error Code

S09008

Error Message

JIT: Inferring return type failed. All return values must have the same data type. RefId: S09008JIT: Inferring return type failed. All return values must have the same data type. RefId: S09008

Probable Causes

This error occurs when a JIT function returns results of different data types.

In the following script, the if condition returns an INT value while the else condition returns a DOUBLE value, which triggers the error:
@jit
def demo(val) {
  if (val > 0) {
    return 1
  } else {
    return 1.0
  }
}
demo(1)

Solutions

Ensure that all return values of a JIT function have the same data type.