C error when used both json2.decode[json2.Any]
and json2.decode[map[string]json2.Any]
#24128
Labels
Bug
This tag is applied to issues which reports bugs.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Unit: cgen
Bugs/feature requests, that are related to the default C generating backend.
Describe the bug
We got C error
cannot convert 'struct x__json2__Any' to 'int'
when decoding a map with genericsjson2.Any
andmap[string]json2.Any
. Commenting one of the two generics code gives different results.Reproduction Steps
Expected Behavior
Trying to decode a map of any instead of any.
Current Behavior
Possible Solution
Workaround 1
Comment
decode_map()
inner code:and we got rid of C error and get expected results:
Workaround 2
Comment
decode_any()
inner code:And we get rid of C error but results are not correct (maybe is another issue):
Additional Information/Context
No response
V version
V 0.4.10 87f92b1
Environment details (OS name and version, etc.)
https://play.vlang.io/p/d3c19509a9
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: