Is there a way to force F # type aliases to be real types in MSIL?
I am working on a set of functions from a large F # library that is used by a lot of top-down code. For reasons too long explained here, I need to go through an intermediate step of moving the types and modules I will be into a new separate F # project and a new namespace and stubbing using type aliases / abbreviations where they used to be in the old big library, for example:type TypeBeingMoved = New.Namespace.TypeBeingMoved
... For modules, I have to be more explicit by actually creating stubs like this for every function defined in the module (this is a bit tedious, but good). The idea is that we need to provide current users of a library that is dissected by multiple versions to migrate to the new smaller library, encouraging them with forced compiler warnings that we'll make the old big library stubs emit - at least that's the plan.
This works fine for modules where such an interrupt works fine.
The problem arises because type aliases are deliberately "discarded" during the translation of F # to MSIL - see https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/type- abbreviations- the idea is that you should really use the type they point to. I would really like my users to do just that, but unfortunately, you have to jump over the hoop described above. So my user's current code just stops compiling because replacing a type with an alias / abbreviation pointing to a different library / namespace results in the type disappearing from the original library DLL. Is there a way to force type generation from a type alias / abbreviation, or create a stub type that is equivalent to a type alias / abbreviation?
source to share
No one has answered this question yet
See similar questions:
or similar: