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
dotnet/fsharp#11424
Currently F# does not treat voidptr as an unmanaged type. Therefore types like nativeptr<voidptr>, etc. cause compiler errors.
However on IL level this works and C# libraries (e.g. Silk.NET.OpenGL) expose methods expecting this kind of argument (which currently can't be created in F# due the above)
The existing way of approaching this problem in F# is to make use of C# to wrap around problematic methods.
Pros and Cons
The advantages of making this adjustment to F# are
Consistency with C#
Convenience
Less surprises
The disadvantages of making this adjustment to F# are that native interop is not an area F# focuses on. However, it's still beneficial to unblock scenarios where we must make use of C#.
This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.
Please tick all that apply:
This is not a breaking change to the F# language design
I or my company would be willing to help implement and/or test this
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
The text was updated successfully, but these errors were encountered:
Agreed, this feels like something that's just the right thing to do. I have approved this in principle. While I cannot speak for the priority of the team to implement, I think this would also make a fine contribution to F# vNext.
dotnet/fsharp#11424
Currently F# does not treat
voidptr
as an unmanaged type. Therefore types likenativeptr<voidptr>
, etc. cause compiler errors.However on IL level this works and C# libraries (e.g. Silk.NET.OpenGL) expose methods expecting this kind of argument (which currently can't be created in F# due the above)

The existing way of approaching this problem in F# is to make use of C# to wrap around problematic methods.
Pros and Cons
The advantages of making this adjustment to F# are
The disadvantages of making this adjustment to F# are that native interop is not an area F# focuses on. However, it's still beneficial to unblock scenarios where we must make use of C#.
Extra information
Estimated cost (XS, S, M, L, XL, XXL): XS to S
Related suggestions: dotnet/fsharp#11424
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
The text was updated successfully, but these errors were encountered: