As data type conversion is a fairly standard operation, Julia is designed to automatically call the convert function in the following scenarios:
- Assigning a value to an array converts the value to the array's element type.
- Assigning a value to a field of an object converts the value to the declared type of the field.
- Constructing an object with new converts the value to the object's declared field type.
- Assigning a value to a variable with a declared type converts the value to that type
- A function with a declared return type converts its return value to that type.
- Passing a value to ccall converts the value to the corresponding argument type.
Let's confirm that these are indeed working as advertised. ...