-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unmarshaling of nested DS Dictionary #9023
Conversation
@@ -533,7 +533,7 @@ private object ToIDictionary(StackValue dsObject, ProtoCore.Runtime.Context cont | |||
{ | |||
try | |||
{ | |||
targetDict[key] = Convert.ChangeType(d.ValueAtKey(key), valueType); | |||
targetDict[key] = d.ValueAtKey(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any necessity for the type conversion in this case. This conversion was throwing the error for the input object (DesignScript.Builtin.Dictionary) not being an IConvertible in the first place.
Thanks @erfajo. Yes, that's one way to do it but we are also trying to fix the generic dictionary case. |
@aparajit-pratap Changes look good to me. Scratch that last question, I see what was going on Let me know when this is ready for a final look, you mentioned you were adding some additional testing |
Thanks @alfarok for the review and testing; I've added some more tests. Merging. |
Purpose
Fix issue with passing nested DesignScript.Builtin Dictionary to ZT node accepting generic Dictionary (Dictionary<string, object>) as argument.
JIRA link: https://jira.autodesk.com/browse/QNTM-4917
Zero touch node definitions used in this example:
The following table shows the different combinations of Dictionary output (rows) being passed into node accepting Dictionary inputs (columns):
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@saintentropy
FYIs
@jnealb