-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Support accessing members of a conditional value #35390
base: main
Are you sure you want to change the base?
Conversation
Note that the updated baselines point to a missing I would like to add a couple of missing test cases before marking as ready:
I am also thinking that it might be a good idea to write the tests so that they do not interact with #28077, so I will probably end up rewriting the existing test. What is the best place for these tests? (if I want to check the behavior on different subclasses, maybe |
The extended `LocustHorde` has two fields which have different types but share the same base type. This is interesting when using SQL constructs to select one of the two fields as they are compatible but have different types.
i.e. for issue dotnet#34589
I extended the tests and kept them in GoW, as the different handling of subclassing is interesting. |
Hello, not sure if this is the right place for suggestions, but conditionals could be nested, to allow handling more than 2 options, like:
The nesting could also be in both branches. Also the properties accessed could be deep like:
What I personally resorted to doing is when visiting a member first find out if it's part of a member chain with a conditional expression at the top, and save all the members along it. |
@Xriuk your first example should already be taken care of by the recursive visit as follows:
The second one needs some additional attention... I'll try to extend the code (and tests) |
This changeset adds support for accessing a member of the result of a conditional expression.
It achieves this by folding the member access into the conditional.
Fixes #34589.