Skip to content

Add linker test coverage for GetUninitializedObject #37739

Description

@MichalStrehovsky

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()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions