You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using try_push on a channel of an interface type causes the C generation to fail.
Reproduction Steps
Try compiling the following code:
module main
interface TestInterface {
a int
}
struct TestStruct {
a int
}
fn main() {
c := chan TestInterface{cap: 1}
c.try_push(TestInterface(TestStruct{a: 1}))
m := <- c
println(m)
}
Expected Behavior
It should print:
TestInterface(TestStruct{
a: 1
})
Current Behavior
It fails compiling with the following error:
/tmp/v_1000/main.10210340489945412125.tmp.c:18128: error: cannot convert 'struct main__TestInterface' to 'void *'
V full version: V 0.4.1 77219de
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
Describe the bug
Using
try_push
on a channel of aninterface
type causes the C generation to fail.Reproduction Steps
Try compiling the following code:
Expected Behavior
It should print:
Current Behavior
It fails compiling with the following error:
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.1 77219de
Environment details (OS name and version, etc.)
V full version: V 0.4.1 77219de
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-18 23:57:39
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: