- 
                Notifications
    You must be signed in to change notification settings 
- Fork 834
Better generic unmanaged structs handling ++ bidirectional F#/C# interop for 'unmanaged' constraint #12154
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
Better generic unmanaged structs handling ++ bidirectional F#/C# interop for 'unmanaged' constraint #12154
Conversation
| 
 I am not sure whether we should emit it just because C# does it as well, since it will change the default behaviour we already have, it will also be not easy to test. | 
e2ddfbb    to
    1222dea      
    Compare
  
    | Before this PR, the  With this PR, the modreq is being emitted. dotnet/vblang#300 Which means that public APIs that should also target VB.NET will need to be aware of this and provide alternatives. | 
| 
 | 
| 
 I don't see why not, I can add it in a separate PR right after this one is merged in. | 
Co-authored-by: Vlad Zarytovskii <[email protected]>
Pretty much a continuation of @TIHan's work on on top of
main(previous PR for reference: #6064).RFC: https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1090-Generic-struct-type-whose-fields-are-all-unmanaged-types-is-unmanaged.md
TODO/FIXES:
IsUnmanagedAttributefor theunmanagedconstraints on params.UnmanagedTypemodreq on type arguments on types- This would be a binary breaking change, we should consider if we want to do it or not.
unmanagedconstraint cannot be used together withnot structconstraint (not the case right now).isUnmanagedon their arguments, tuple/record hasn't been solved yet.** TEST list ** (Tomas's braindump)
MyStruct<MyOtherStruct<StructTuple<int,byte>>>)