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
{{ message }}
Repository navigation
The unmanged generic constraint is not recognized by C# #11935
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.
The unmanaged constraint has disappeared. 'T does not have any constraints at all.
Because the unmanaged constrained appeared first in F#, it looks like it is stored in an F#-specific way (the SignatureData I guess?).
This is how it sould be represented to be recognized by C# (and F# for backwards compatibility, some code omitted for brevity):
namespaceSystem.Runtime.CompilerServices// This is a compiler-generated attribute. It has two other attributes,// CompilerGenerated and Embedded, the latter of which is also compiler-generated.typeinternalIsUnmanagedAttribute()=inherit System.Attribute()namespaceMyLibrarytypeC<[<IsUnmanaged>]'Twhen'T:struct,unmanaged>=classend
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.
Activity
vzarytovskii commentedon Aug 9, 2021
Yeah, we don't emit it now, I plan to fix it as part of
https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1090-Generic-struct-type-whose-fields-are-all-unmanaged-types-is-unmanaged.md
Complete codegen regression test suite: add remaining 32 issues
Add regression tests for 4 previously-fixed codegen issues
Add regression tests for 3 previously-fixed codegen issues
Add regression tests for 3 previously-fixed codegen issues
Add regression tests for 3 previously-fixed codegen issues (#19309)