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

Keep GetInstance method on custom marshalers #1308

Merged
merged 4 commits into from
Jul 6, 2020

Conversation

MichalStrehovsky
Copy link
Member

Fixes #1281.

We also need a trimming directive in CoreLib that says we want to keep all methods on ICustomMarshaler to make this work E2E, but that's not a linker concern anymore (and it's not testable here...).

Fixes dotnet#1281.

We also need a trimming directive in CoreLib that says we want to keep all methods on ICustomMarshaler to make this work E2E, but that's not a linker concern anymore (and it's not testable here...).
@@ -1877,6 +1885,16 @@ protected bool MarkDefaultConstructor (TypeDefinition type, in DependencyInfo re
return MarkMethodIf (type.Methods, MethodDefinitionExtensions.IsDefaultConstructor, reason, sourceLocationMember) != null;
}

protected bool MarkGetInstanceMethod (TypeDefinition type, in DependencyInfo reason, IMemberDefinition sourceLocationMember)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: why return bool (not used in here)... and also why protected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copy-pasted MarkDefaultConstructor above. No special reason. Undone.

Copy link
Contributor

@marek-safar marek-safar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same question as Vitek, otherwise LGTM

@MichalStrehovsky MichalStrehovsky merged commit ee586ba into dotnet:master Jul 6, 2020
@MichalStrehovsky MichalStrehovsky deleted the marshalAs branch July 6, 2020 12:47
tkapin pushed a commit to tkapin/runtime that referenced this pull request Jan 31, 2023
Fixes dotnet/linker#1281.

We also need a trimming directive in CoreLib that says we want to keep all methods on ICustomMarshaler to make this work E2E, but that's not a linker concern anymore (and it's not testable here...).

Commit migrated from dotnet/linker@ee586ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linker breaks custom marshalers
3 participants