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 <vzaritovsky@hotmail.com>
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>>>)