Closed
Description
Unless I'm missing something here, seems like inlining the creation of a function and calling it in this manner seems to be broken:
Here's a minimal example:
let normalFunc = (): (x:i32) => i32 => {
let myFunc = (x: i32): i32 => {
return 24 + x;
}
return myFunc;
}
assert(normalFunc()(1) == 25);
Compiler Error:
ERROR TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'closure-common-js-patterns/normalFunc' has no compatible call signatures.
assert(normalFunc()(1) == 25);