Use reflection or a compile-time only shim assembly to reference unexposed corelib types.#61802
Merged
jkoritzinsky merged 8 commits intodotnet:mainfrom Nov 20, 2021
Merged
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
jkotas
reviewed
Nov 18, 2021
jkotas
reviewed
Nov 18, 2021
| @@ -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. | |||
AaronRobinsonMSFT
approved these changes
Nov 18, 2021
Member
AaronRobinsonMSFT
left a comment
There was a problem hiding this comment.
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.
Member
Author
|
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)
AaronRobinsonMSFT
approved these changes
Nov 19, 2021
Co-authored-by: Aaron Robinson <[email protected]>
This was referenced Nov 29, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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