vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.71k stars 2.16k forks source link

cgen error `cannot convert 'int' to 'struct _result_void'` #18709

Closed einar-hjortdal closed 1 year ago

einar-hjortdal commented 1 year ago

Describe the bug

Encountered another cgen error, repository link here. The branch cgen_error-#2 is not going to change so the problem will be frozen in time.

error: cannot convert 'int' to 'struct _result_void'

Expected Behavior

Not a cgen error

Current Behavior

cgen error

Reproduction Steps

  1. git clone https://github.com/Coachonko/redis.git && cd redis/
  2. git checkout cgen_error-#2
  3. v run src/cmd_test.v

Possible Solution

No response

Additional Information/Context

No response

V version

Current V version: V 0.3.4 60f9f53, timestamp: 2023-06-29 07:01:21 +0300

Environment details (OS name and version, etc.)

V full version: V 0.3.4 ee4150f.60f9f53
OS: linux, Linux version 5.14.0-284.11.1.el9_2.x86_64 (mockbuild@pp-el9-x86) (gcc (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4), GNU ld version 2.35.2-37.el9) #1 SMP PREEMPT_DYNAMIC Tue May 9 11:00:23 UTC 2023
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz

getwd: /home/coachonko/Documents/projects/vlang/redis
vexe: /home/coachonko/.local/lib64/v/v
vexe mtime: 2023-06-29 10:46:12

vroot: OK, value: /home/coachonko/.local/lib64/v
VMODULES: OK, value: /home/coachonko/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.39.3
Git vroot status: weekly.2023.26-22-g60f9f53e
.git/config present: true

CC version: cc (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4)
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3
felipensp commented 1 year ago

The problem happens when passing a interface function member as callback.