When an inline value references a private value, the generated inlined code attempts to import the private value, which is not exported, causing an import error.
Repro code
Reproducing requires multiple files, so I made a reproduction repository:
I just hit this when referencing a private string defined at the top-level of a module. In that case, adding [<Literal>] gets it to inline while still being private.
Description
When an inline value references a private value, the generated inlined code attempts to import the private value, which is not exported, causing an import error.
Repro code
Reproducing requires multiple files, so I made a reproduction repository:
https://github.com/joprice/fable-repro/blob/2283eb46351bef3cc39ac02e9c5c4c303c7b6a8b/Client.fs#L10
An overview of the problem:
In one file:
In another file:
This will generate an error like
Expected and actual results
Compilation should fail if an
inline
value references a private value, if the private value is not itselfinline
, instead of generating invalid code.For comparison, fsc returns the following error in this case:
Related information