This commit is contained in:
Felipe Pena 2025-08-23 09:53:11 -03:00
parent 5911fc81f8
commit c22bf35ada
3 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,2 @@
string (*cb2) (void) = &cb1;
string (*cb3) (void) = &cb2;

View file

@ -0,0 +1,3 @@
true
true
true

12
vlib/v/gen/c/testdata/assign_fn_addr.vv vendored Normal file
View file

@ -0,0 +1,12 @@
const hello = 'hello world!'
fn main() {
cb1 := fn () string {
return hello
}
cb2 := &cb1
cb3 := &cb2
println(voidptr(cb1) != voidptr(cb2))
println(voidptr(cb2) != voidptr(cb3))
println(voidptr(cb1) != voidptr(cb3))
}