Looks like there was a bug exposed by this use case…, the following will apply once this fix 9 is merged.
Our C++ value type (IValue) doesn’t have any concept of optional/not, it is either some concrete value (e.g. Tuple[int, int]) or None. Only the JIT’s type system knows what things can be optional. You can see a small example of how to construct one here 8.
The C++ API tests 8 may also be helpful.