let x (a: int) = 1
let y (a: int, b: string) = 2
let z (a: int) (b: string) = 3
The first succeeds
let! x = importValueDynamic Client.x
x (1)
The second fails at compile time with
./Program.fs(10,17): (10,44) error FABLE: The imported value is not coming from a different file
let! y = importValueDynamic Client.y
y (1, "a")
The third fails at runtime with
TypeError: z(...) is not a function"
let! z = importValueDynamic Client.z
z 1 "a"
In the case of the dynamic failure, I would expect any public value to be able to be imported and have the call semantics line up (e.g. not try to call a multiple arity function as a curried function).
In the case of the static failure, I wonder if the inliner is getting in the way, so that the value is detected as being from the same file?
Description
importValueDynamic
fails at either runtime or compile time for functions with more than a single argument.Repro code
I reproduced in a separate repository, since it requires multiple files:
https://github.com/joprice/fable-repro/blob/435dff0128f35b968b49d89efbd0ced9fbe85e2f/Program.fs#L12
Expected and actual results
With the following definitions,
The first succeeds
The second fails at compile time with
The third fails at runtime with
In the case of the dynamic failure, I would expect any public value to be able to be imported and have the call semantics line up (e.g. not try to call a multiple arity function as a curried function).
In the case of the static failure, I wonder if the inliner is getting in the way, so that the value is detected as being from the same file?
Related information
4.22.0