Skip to content

Allow referencing the types of nested properties - #14

Open
ncguilbeault wants to merge 2 commits into
bonsai-rx:mainfrom
ncguilbeault:ng-dev/nested-type-hierarchy
Open

Allow referencing the types of nested properties#14
ncguilbeault wants to merge 2 commits into
bonsai-rx:mainfrom
ncguilbeault:ng-dev/nested-type-hierarchy

Conversation

@ncguilbeault

Copy link
Copy Markdown

EnumerateTypeHierarchy only walked the interfaces and base chain of the source type, so the type of any property was never registered with the custom type provider and could not be named in an expression. This PR introduces a change to EnumerateTypeHierarchy to traverse the types of properties as well, and a guard was put in place to ensure visited types only register once, to prevent infinite recursion from types that reference each other.

One caveat to this approach compared to before is that each newly visited type contributes its own base chain and interfaces, so complex types can produce a fairly deep hierarchy. It may be worth bounding the traversal by depth, or skipping certain types if size becomes a problem.

Fixes #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Types of nested properties are not registered with the custom type provider

1 participant