-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use reflection or a compile-time only shim assembly to reference unexposed corelib types. #61802
Use reflection or a compile-time only shim assembly to reference unexposed corelib types. #61802
Conversation
…posed corelib types. Use reflection for the hosting tests as they'll be around indefinitely. Use the ref-assembly trick for ICastable testing since ICastable testing would require Ref-emit which makes the test significantly less readable and since ICastable will be going away within the .NET 7 timeframe. Supercedes dotnet#61754
@@ -0,0 +1,17 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<!-- | |||
ICastable.CoreLib provides a "shim" definition of ICastable in System.Private.CoreLib for the Castable test suite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat hack :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is works too.
My opinion here is that this sort of code is much harder to work with and is far more annoying to use than simply having a pseudo ref assembly. The shim/proxy type approach works but it does make things much harder to debug in managed code.
Thanks for removing the SPCL ref logic, that is a win either way.
Looks like things break really badly if CoreLib has any types marked with |
…me of that complexity to handle IClassFactory (since type equivalence in corelib breaks things really badly)
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Use reflection for the hosting tests as they'll be around indefinitely.
Use the ref-assembly trick for ICastable testing since ICastable testing would require Ref-emit which makes the test significantly less readable and since ICastable will be going away within the .NET 7 timeframe. Supercedes #61754