-
Notifications
You must be signed in to change notification settings - Fork 850
Closed
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
Consider the following class declaration:
type C<'T when 'T: unmanaged> = class endWhen decompiled, it results in the following C# class declaration:
[Serializable]
[CompilationMapping(SourceConstructFlags.ObjectType)]
public class C<T>
{
}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):
namespace System.Runtime.CompilerServices
// This is a compiler-generated attribute. It has two other attributes,
// CompilerGenerated and Embedded, the latter of which is also compiler-generated.
type internal IsUnmanagedAttribute() = inherit System.Attribute()
namespace MyLibrary
type C<[<IsUnmanaged>] 'T when 'T: struct, unmanaged> = class endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
Done