Repository navigation
Implement marking of type hierarchies - #4
Merged
LakshanF merged 1 commit intoMar 25, 2021
Merged
Conversation
Collaborator
Author
|
@MichalStrehovsky can you please take a look - it should be close to what we've discussed. Currently this is done in a private branch - once we have the whole thing working (which is basically done after this PR) we will move it over to main. |
Sigh. Notifications for non-microsoft repos go to my personal email address and my personal email is messier than my personal life (so a whole new level of messy). Since it's already merged anyway, I'll take a look at this once this moves to the linker repo. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements marking in type hierarchies
The general idea is to have a cache of type->annotation which is populated from
MarkStep.MarkType. We then use the cache inObject.GetTypeto get the annotation. It's also used to get the set of types which are candidates to be marked during theObject.GetTypeprocessing.Due to how interfaces are marked (delayed and in effectively random order), the cache has to store all interfaces - even those without annotations. For non-interface types it only stores annotated types and their hierarchies.
Behavior:
Object.GetTypeis just a trigger, it doesn't actually tell which of the base types was used and thus potentially subset the annotations applied. Again, only overmarking which is not observableImplementation details:
MarkStepandReflectionMethodBodyScannerMarkStepsince logically it belongs more to theDataFlowside of thingsReflectionMethodBodyScannersince it needs to maintain global state (the scanner is short lived)ReflectionMethodBodyScannerbut it's not too bad