The annotation for GetUninitializedObject is going to rely on the fact that linker treats all valuetypes as implicitly boxed. We need a test that starts failing if this is ever broken.
interface IFoo { int Frob(); }
struct Foo : IFoo
{
int IFoo.Frob() => 100;
}
static int Main()
{
var o = (IFoo)RuntimeHelpers.GetUninitializedObject(typeof(Foo));
return o.Frob()
}
The annotation for GetUninitializedObject is going to rely on the fact that linker treats all valuetypes as implicitly boxed. We need a test that starts failing if this is ever broken.