-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
F# code generation: Declared type parameters do not appear in the type being abbreviated #1885
Comments
I found out fsharp/fslang-suggestions#597 @A-Manning Any progress on this? |
@DejanMilicic Fixing this is tricky since it requires patching the F# compiler to accept these type abbreviations. I've already proposed making the changes here fsharp/fslang-suggestions#597 It's difficult for me to develop the F# compiler on linux, since many of the test suites won't run, and so it's difficult to test changes. dotnet/fsharp#7075 (comment) If the fsharpqa test suite is ported over, then it would be more practical for me to make the required changes and then we can wait to see if it gets accepted into the next version of F#. Nothing is going to be happening on this front for at least a few months, so for now I'd recommend targeting a different language for code generation if that's possible. |
@A-Manning Thanks, this is valuable information. This basically means I can put FStar on hold and observe status of fsharp/fslang-suggestions#597 |
FYI, we are working with @mateuszbujalski to fix this in the F* compiler by adding a pass to extraction to remove unused type variables in extracted type abbreviations. cf #1087 |
@nikswamy awesome news. I went over all issues related to F# code generation and it seems like this one is the last major problem? |
@DejanMilicic I would say there's one more that is related to F# implementation of "unsafe_coerce". You can take a look at #2067 (comment) for an example of issue it causes. But it also prevents other things that can't be expressed directly with F# type system. E.g. code using some_type would fail at runtime currently.
It looks like it's not that easy to implement equivalent of Obj.magic in .net and we're discussing with @nikswamy how to best deal with it. |
After generating F# code for Red/Black tree from a file
https://github.com/FStarLang/FStar/blob/master/examples/data_structures/RBTree.fst
generated F# code contains the following declarations
which are producing following compilation error
I am using VS2019 with FSharp.Core 4.7.0
The text was updated successfully, but these errors were encountered: