System.InvalidCastException: 'Object must implement IConvertible.' when invoking callback function with object return value #1534
Unanswered
jsiemensLatitudegeo
asked this question in
Q&A
Replies: 1 comment
-
I think that your Generally if you want to implement JavaScript functionality, the signature should be |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version used
Tried both 2.11.58 and 3.0.0-beta-204.
Describe the bug
I'm trying to implement a function that returns a value, and when the value is an object, I get an InvalidCastException.
To Reproduce
Expected behavior
The callback function is called, and the object is returned.
Additional context
When the callback is called with a primitive value like an integer, and an integer is returned, it works fine. It fails for reference types like arrays.
I was trying to implement the JavaScript flatMap method:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap
Beta Was this translation helpful? Give feedback.
All reactions