Closed Preston159 closed 4 months ago
@Preston159 This seems to only affect delegates, as changing the type from
type DelegateType = delegate of unit -> unit
to
type DelegateType = unit -> unit
, and the call site from del.Invoke ()
to del ()
works as expected.
Not a fix, obviously, just a workaround if using delegates is not critical.
@Preston159 Thanks for reporting the issue, should be resolved in the next release.
@ncave Happy to help. Thanks for the quick resolution, both the workaround and the fix!
I think this change caused some regressions. Trying to come up with a repro case.
@ncave
@OnurGumus Perhaps, let me know if you can find an example. The original code was done to resolve #2400.
@ncave Hi, I reproduced the problem with minimal example and created issue. It's not related to this bug I think.
Description
When a function takes another function as a parameter, which in turn takes a function as a parameter, and attempts to call that function by passing in a function, Fable incorrectly calls the innermost function and passes in its return value rather than passing the function itself.
Repro code
REPL
Expected and actual results
Expected console output
del is a function
testFunc called
Actual console output
testFunc called
del is undefined
Uncaught TypeError: del is not a function
Related information
4.19.3