merge_in_place and merge functions from maps module raise an error #22564
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: Type System
Bugs/feature requests, that are related to the V types system.
Unit: vlib
Bugs/feature requests, that are related to the vlib.
Describe the bug
Greetings.
The functions can't copy the values from m2 to m1.
Reproduction Steps
Expected Behavior
The output should be:
Current Behavior
Both, merge_in_place and merge raise the same error, which is:
Possible Solution
This solution was proposed by
iostream.c
in the Telegram chanel:"the way to fix this is using m1[k] = if V is $map { v.clone() } else { v } internally".
Additional Information/Context
I'am just following the v documentation and add some other lines of code to test.
V version
V 0.4.8 72b4804
Environment details (OS name and version, etc.)
OS: Fedora Linux 39
PC: Laptop HP 15aw002la
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: