c3c icon indicating copy to clipboard operation
c3c copied to clipboard

inference doesn't work through && in lambdas

Open xfcasio opened this issue 1 year ago • 0 comments

the line Callback *f = &&(fn void() { }); yields the error:

12: fn void main() {
13:   Callback *f = &&(fn void() { });
                    ^^^^^^^^^^^^^^^^^
(/home/user/c3/main.c3:13:17) Error: Implicitly casting 'fn void()*' to 'Callback*' (fn String()*) is not permitted, but you may do an explicit cast by placing '(Callback*)' before the expression.

but it compiles and runs correctly when doing Callback *f = &&((Callback) fn void() { });

xfcasio avatar Jul 30 '24 23:07 xfcasio