Open kendfss opened 1 year ago
Apparently this is an advancement from https://github.com/vlang/v/issues/12906
Given that, perhaps more for my use case than the above or https://github.com/vlang/v/issues/14416, this can be circumvented by changing map(whitener(10))
to map(whitener(10)(it))
it may be worth adding a type/syntax error.
That would mean that array.map(my_func)
would be invalidated in favour of array.map(my_func(it))
. Due to backward compatibility violation this should probably be handled by v fmt
.
Tagging @medvednikov for a decision. Happy to learn what's necessary to make the changes.
Describe the bug
array mappings with a single argument that is a closure are not correctly transpiled.
Expected Behavior
Current Behavior
Reproduction Steps
Possible Solution
Well the reason is the handling of closure mappings. I don't know enough about C to understand why
{
is expected where;
is found but the linearray_push_noscan((array*)&_t1, &ti);
should be something likearray_push_noscan((array*)&_t1, &(ti(it)));
Additional Information/Context
I was tinkering with v/examples/2048/2048.v
V version
V 0.3.3 d7a418f
Environment details (OS name and version, etc.)
OS: linux, Linux Mint 20.3 Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz CC version: cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
getwd: /home/kendfss/gitclone/clones/kendfss/vbugs vmodules: /home/kendfss/.vmodules vroot: /home/kendfss/gitclone/clones/vlang/v vexe: /home/kendfss/gitclone/clones/vlang/v/v vexe mtime: 2023-03-06 18:58:06 is vroot writable: true is vmodules writable: true V full version: V 0.3.3 d7a418f
Git version: git version 2.25.1 Git vroot status: weekly.2023.10-dirty .git/config present: true thirdparty/tcc status: thirdparty-linux-amd64 12f392c3