v icon indicating copy to clipboard operation
v copied to clipboard

clang build error when pass variable from anon closure fn to anon closure fn

Open StringNick opened this issue 3 years ago • 0 comments

V version: OS:

What did you do?

module main
interface Test {
    test(fn(Test))
}
struct Test1 {
}
fn (t Test1) test(f fn(Test)) {
    f(Test(t))
}
fn main() {
    t := Test1{}
    
    t.test(fn[t](t1 Test) {
        println('$t, $t1')
        t.test(fn[t](t2 Test) {
            println('$t, $t2')
        })
    })
}

https://devbits.app/play/qlB0M0vcF6LI What did you expect to see? no error

What did you see instead? error

StringNick avatar Jul 29 '22 14:07 StringNick