You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling a function via a mutable alias, the compiler incorrectly generates a curried application. The only workaround I found is to use an anonymous function with tupled arguments (see mutX4).
Repro code
letx a b c = a + b + c
lety= x
let mutablemutX1= x
let mutablemutX2=fun a b c -> x a b c
let mutablemutX3=fun a b c -> y a b c
let mutablemutX4=fun(a,b,c)-> y a b c
y 123|> ignore
mutX1 123
mutX2 123// this is the only version that produces valid code
mutX4 (1,2,3)
The generated code is invalid, attempting to call functions with more arguments than they accept. The compiler should either fail and require the user to write out a tupled forwarding function (as is the case for attempting to define an explicit mutable function Mutable function values should be written 'let mutable f = (fun args -> ...)'), or ideally, the correct forwarding arguments are generated and no special handling is needed.
Related information
Fable version: 4.19.2
Operating system: OSX
The text was updated successfully, but these errors were encountered:
Description
When calling a function via a mutable alias, the compiler incorrectly generates a curried application. The only workaround I found is to use an anonymous function with tupled arguments (see mutX4).
Repro code
Fable repl
Expected and actual results
The generated code is invalid, attempting to call functions with more arguments than they accept. The compiler should either fail and require the user to write out a tupled forwarding function (as is the case for attempting to define an explicit mutable function
Mutable function values should be written 'let mutable f = (fun args -> ...)'
), or ideally, the correct forwarding arguments are generated and no special handling is needed.Related information
The text was updated successfully, but these errors were encountered: