error: cannot convert 'struct array' to 'int' #17381
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
V throws an error when I try to access a certain function in an array of functions given as an argument.
Expected Behavior
Should compile properly and let me access the function I want
Current Behavior
Reproduction Steps
Possible Solution
I tried commenting out the whole for loop and just hard-coding
println(functions[0](s[0]))
-- that's fine. But once I doprintln(functions[gears[0]](s[0]))
, it throws the same error.Additional Information/Context
Potentially related to #15232 ? But in my case I am not passing a slice where a single value is expected.
V version
V 0.3.3 b1ed1d3
Environment details (OS name and version, etc.)
OS: linux, Ubuntu 22.04.2 LTS
Processor: 16 cpus, 64bit, little endian, 12th Gen Intel(R) Core(TM) i5-1240P
CC version: cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
getwd: /home/neniu/Documents/Gitlab/algos
vmodules: /home/NAME/.vmodules
vroot: /home/NAME/v
vexe: /home/NAME/v/v
vexe mtime: 2023-02-22 03:28:32
is vroot writable: true
is vmodules writable: true
V full version: V 0.3.3 58e150d.b1ed1d3
Git version: git version 2.34.1
Git vroot status: weekly.2023.08-8-gb1ed1d3b
.git/config present: true
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3
The text was updated successfully, but these errors were encountered: