You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confusingly, this results in: Error: Illegal value for Message.Field .Child.foo of type uint32: object (not an integer). I believe the correct behavior should be serializing FakeChild as an instance of Child, as this will mean that imported types will serialize correctly as child messages.
The text was updated successfully, but these errors were encountered:
When given a single argument, the constructor has to distinguish if it's either just referencing the first field or if it is an object containing fields (it allows both multiple arguments in field declaration order and a single object). The argument could be another message (which is an object), just referencing the first field in declaration order.
As a result, the else condition tries to set the first field's value (this is Child.foo) to the argument, which is an instance of FakeChild.
I'll think about a solution, but unfortunately, I don't see a good one atm except dropping field declaration order entirely.
Edit:Well, there seems to be a bit more to that as an instance of Child works. Still puzzled. An instance of child works as there is a check in place here which circumvents the issue. This happens only if the statements returns false (not a proper instance). A possible solution could be placed right below the instanceof check statement.
Definition:
Code:
Confusingly, this results in:
Error: Illegal value for Message.Field .Child.foo of type uint32: object (not an integer)
. I believe the correct behavior should be serializingFakeChild
as an instance ofChild
, as this will mean that imported types will serialize correctly as child messages.The text was updated successfully, but these errors were encountered: