Each structure element is associated with a data type. Data types are also associated with function return values and function arguments.
When creating expressions, the editor checks that data types are compatible. Data types are compatible if it is possible to automatically convert from one type to another. For example, a string data type is compatible with the date data type because it is possible to convert a string representation of a date to a date representation (with the type of Date). However, a numeric data type cannot be converted to a date and is thus not compatible.
If the data type of a child expression (often a structure/map element) does not match the data type of its parent expression (and assuming they are compatible data types), code is automatically generated with the map to convert from the child's type to the parent's type.
A runtime error will occur if the data in the document is not in a valid format for type conversion. For example, suppose you are mapping a string to a date. If the string is not the valid date format, the runtime error is signaled.