C gen error when spawning function with mutable type #19425
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: cgen
Bugs/feature requests, that are related to the default C generating backend.
Describe the bug
I wasn't fully able to find exactly the reason the C gen errors, so apologies if the title is incorrect. But basically, the V code on the reproduction steps generated a C gen error.
Reproduction Steps
Try to compile the following code:
Expected Behavior
Should compile and print:
Current Behavior
Fails to C gen
Possible Solution
No response
Additional Information/Context
It seems that the presence of a mutable
io.Writer
influences the C code generation.V version
V 0.4.1 1c9ab77
Environment details (OS name and version, etc.)
V full version: V 0.4.1 1c9ab77
OS: linux, Linux version 6.4.12-200.fc38.x86_64 (mockbuild@30894952d3244f1ab967aeda9ed417f6) (gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1), GNU ld version 2.39-9.fc38) #1 SMP PREEMPT_DYNAMIC Wed Aug 23 17:46:49 UTC 2023
Processor: 64 cpus, 64bit, little endian, Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
getwd: /home/shockwave-1
vexe: /home/shockwave-1/v/v
vexe mtime: 2023-09-23 15:26:12
vroot: OK, value: /home/shockwave-1/v
VMODULES: OK, value: /home/shockwave-1/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.41.0
Git vroot status: weekly.2023.38-5-g77219de1
.git/config present: true
CC version: cc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3
Important
You can vote for this issue using the 👍 reaction. More votes increase the issue's priority
for developers.
Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.
The text was updated successfully, but these errors were encountered: