When invoking a workflow file and passing a wrong argument type IN, it will throw error.
When invoking a workflow file and storing return (OUT) argument in a wrong variable type, it will convert the value (even if no implicit conversion exists).
This leads to uncontrolled value changes between workflows and hiding design errors (non-compatible types paired).
Didn’t test all types, but after short investigation I’d expect it to also “treat as the same”:
anything representing numbers
anything that is serializable to a number (enums, bools)
anything that serializes to the same structure (tested after uploading - SortedList(Of Integer, Double) and Dictionary(Of String, Integer) are interchangeable…)
- Download attached project.
- Run Main.xaml.
- Observe that:
- A Double is stored as a String (using default culture)
- A Double is stored as an Int (losing decimal precision)
- A String is stored as a Double (implicitly parsing)
Judging by the error messages when you really go wild with type mismatches, it seems to be using Json serialization when types don’t match (can’t say if also uses it if it matches).
Throws error, same as when IN argument doesn’t match.
Last stable behavior: N/A
Last stable version: N/A (don’t know)
OS Version: Win 10
Others if Relevant: (workflow, logs, .net version, service pack, etc):
InvokeOutArgumentsTypeTest.zip (14.2 KB)
Tested in 2018.1 and 2018.4, both give unexpected behaviour.
Make it throw an exception of mismatched arguments, same as with IN arguments.