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 IDynamicInterfaceCastable interface #37042

Merged
merged 14 commits into from
Jun 12, 2020

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented May 27, 2020

Approved API: #36654

  • Add IDynamicInterfaceCastable and DynamicInterfaceCastableImplementation
  • IDynamicInterfaceCastable.GetInterfaceImplementation is called as a fallback for isinst, castclass, and interface dispatch when casting in the normal way fails.
  • Add tests

cc @AaronRobinsonMSFT @jkoritzinsky

@Dotnet-GitSync-Bot
Copy link
Collaborator

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@benaadams
Copy link
Member

Does RuntimeHelpers.CoreCLR.cs also need to change?

// Types that require non-trivial interface cast have this bit set in the category
private const uint enum_flag_NonTrivialInterfaceCast = 0x00080000 // enum_flag_Category_Array
| 0x40000000 // enum_flag_ComObject
| 0x00400000;// enum_flag_ICastable;

@elinor-fung
Copy link
Member Author

Yes - that is changed: https://github.com/dotnet/runtime/pull/37042/files#diff-62699d7b49d1d40e84362b31c5df4db4R343

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

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

src/coreclr/src/vm/castableobject.cpp Outdated Show resolved Hide resolved
src/coreclr/src/vm/castableobject.cpp Outdated Show resolved Hide resolved
src/coreclr/src/vm/prestub.cpp Outdated Show resolved Hide resolved
@elinor-fung elinor-fung changed the title Add ICastableObject interface Add IDynamicInterfaceCastable interface Jun 3, 2020
src/coreclr/src/vm/jitinterface.cpp Outdated Show resolved Hide resolved
src/coreclr/src/vm/methodtable.h Outdated Show resolved Hide resolved
src/coreclr/src/vm/prestub.cpp Outdated Show resolved Hide resolved
@elinor-fung elinor-fung marked this pull request as ready for review June 3, 2020 17:59
elinor-fung and others added 2 commits June 9, 2020 17:14
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@elinor-fung elinor-fung merged commit f633f18 into dotnet:master Jun 12, 2020
@elinor-fung elinor-fung deleted the addICastableObject branch June 12, 2020 18:49
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants