Just noting that this is indeed a validated IL (i.e.
.class public sequential ansi sealed StructNewStruct`1<valuetype .ctor ([mscorlib]System.ValueType) T> extends [mscorlib]System.ValueType
compiles like a simpler
.class public sequential ansi sealed StructNewStruct`1<valuetype .ctor T> extends [mscorlib]System.ValueType
), but I still do not have code that would do something else for them, which provides a simple where T:struct (or (Of T As Structure) in VB.NET and <valuetype T> in IL).
In particular, Nullable structures are no longer allowed for any general argument with a simple struct constraint. (It seems that Nullable objects are classes for almost all purposes except storage.)
So, in the end, Nullable<T> current (equivalent) where T:ValueType, struct, new() seems to be identical to where T:struct currently.
For your information, I used my updated DotLisp, which allows you to create generic types (only using MakeGenericType ) to try to create the StructNewStruct<t> and StructStruct<t> (*) types for all types in all 4.0 Framework builds that load "unusual" "assemblies (for example, System.Web may not have been loaded). (If there are any "special" types in assemblies of "obscure" frameworks, let me know and I guarantee that they are downloaded and tested.) All types with success or failure coincided with both structures.
(*) StructStruct<T> where T:struct
source share