Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linker test coverage for GetUninitializedObject #37739

Open
Tracked by #64603
MichalStrehovsky opened this issue Jun 11, 2020 · 2 comments
Open
Tracked by #64603

Add linker test coverage for GetUninitializedObject #37739

MichalStrehovsky opened this issue Jun 11, 2020 · 2 comments
Labels
area-System.Runtime linkable-framework Issues associated with delivering a linker friendly framework
Milestone

Comments

@MichalStrehovsky
Copy link
Member

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()
}
@MichalStrehovsky MichalStrehovsky added this to the 5.0 milestone Jun 11, 2020
@MichalStrehovsky MichalStrehovsky self-assigned this Jun 11, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Jun 11, 2020
MichalStrehovsky added a commit to MichalStrehovsky/runtime that referenced this issue Jun 11, 2020
We don't have a good annotation for this so going with a superset. We could choose to intrinsify it in the linker to restrict this if necessary.

Test addition for the valuetype case tracked here: dotnet#37739.
@joperezr joperezr added the linkable-framework Issues associated with delivering a linker friendly framework label Jul 7, 2020
@joperezr
Copy link
Member

joperezr commented Jul 7, 2020

@MichalStrehovsky this should be easy to test now with the Trimming Tests infrastructure. Let me know if you need any help with using it or writing this test.

@joperezr joperezr removed the untriaged New issue has not been triaged by the area owner label Jul 7, 2020
@eerhardt
Copy link
Member

This isn't needed to ship 5.0, so moving to 6.0.

@eerhardt eerhardt modified the milestones: 5.0.0, 6.0.0 Jul 30, 2020
@eerhardt eerhardt modified the milestones: 6.0.0, 7.0.0 Jul 30, 2021
@jeffhandley jeffhandley modified the milestones: 7.0.0, Future Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

No branches or pull requests

5 participants