-
Code:
Why calling a lambda in expressions causes an error "Cannot use void in expression position"? I think this is a bug. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I'm guessing it's because your function doesn't have a return type? |
Beta Was this translation helpful? Give feedback.
-
Lambda calls require using a type designator. Just how it was made. |
Beta Was this translation helpful? Give feedback.
-
Lambdas are typed erased to just being a single So whenever you call a lambda, the compiler needs to know what return type you're expecting, to check the signature (stored at runtime). This comes from
|
Beta Was this translation helpful? Give feedback.
Lambdas are typed erased to just being a single
function
type. That's how tables and arrays work too.So whenever you call a lambda, the compiler needs to know what return type you're expecting, to check the signature (stored at runtime).
This comes from
fn(a,b,c):d
)