Forum

[2021.4 - 464] Creating an IOBox from an Optional<T> input pin throws an exception

hélo,

as reported in the chat, say you create an operation that has one of its input pins set to Optional<Spread<Float32>>, if you click that pin and try to create an IOBox from it with middle-click, VL throws this exception :

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: GenericArguments[0], 'VL.Lib.Collections.Spread1[System.String]’, on ‘VL.Core.Serialization+OptionalSerializer1[TValue]' violates the constraint of type 'TValue'. ---> System.TypeLoadException: GenericArguments[0], 'VL.Lib.Collections.Spread1[System.String]’, on 'VL.Core.Serialization+OptionalSerializer1[TValue]' violates the constraint of type parameter 'TValue'.

full exception is visible here

repro gif :

optional

workaround is of course to use a Create (Optional), at least until we can feed it data directly 👀

edit: funny thing is that it looks like after that exception happened, HasValue would always return false even if something was connected upstream

Thanks. Fixed in upcoming.

1 Like