Type Inference and Type Validation

When IArray, Function, or Any is the type of a node's input or output, the compiler has to figure out what the precise type of data is that is flowing through the connection (for example, is IArray an array of integers or an array of Booleans?).

The process of determining the type is called "type inference." At the same time, types are checked to see that they are consistent. For example, the Add operator requires the two inputs to have the same type, whether it be Int32, Single, or Vector3. However, you can connect an Int32 to the first input and a Single to the second input in the Graph Editor, and no error will be reported until you try to validate the graph. Then the error will be reported as a "type inference error. "

Tip for Advanced Users

In some cases, the type inference algorithm is unable to determine the precise type and a hint has to be given to the compiler. This occurs frequently when using "Tuples." There are a few ways to accomplish this: