Implement marking of type hierarchies #4
Merged
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.GetType
to get the annotation. It's also used to get the set of types which are candidates to be marked during theObject.GetType
processing.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.GetType
is 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:
MarkStep
andReflectionMethodBodyScanner
MarkStep
since logically it belongs more to theDataFlow
side of thingsReflectionMethodBodyScanner
since it needs to maintain global state (the scanner is short lived)ReflectionMethodBodyScanner
but it's not too bad