Skip to content
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

Disallow 'with' in expression trees #45095

Merged
merged 3 commits into from
Jun 15, 2020
Merged

Disallow 'with' in expression trees #45095

merged 3 commits into from
Jun 15, 2020

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Jun 12, 2020

No description provided.

@jcouv jcouv self-assigned this Jun 12, 2020
@jcouv jcouv marked this pull request as ready for review June 12, 2020 03:26
@jcouv jcouv requested a review from a team as a code owner June 12, 2020 03:26
@jcouv
Copy link
Member Author

jcouv commented Jun 12, 2020

Never mind. It should be possible to support

@jcouv jcouv closed this Jun 12, 2020
@jcouv jcouv deleted the block-trees branch June 12, 2020 05:27
@jcouv jcouv restored the block-trees branch June 12, 2020 18:09
@jcouv
Copy link
Member Author

jcouv commented Jun 12, 2020

Turns out we would need a new API to support this scenario (representing the with expression with a Call as the receiver of a MemberInit) so we should block for now. Re-opening the PR.


We can't do MemberInit(Call(...), Initializers) because MemberInit only works with a New at the moment.

We would need an API like public static System.Linq.Expressions.MemberInitExpression MemberInit (System.Linq.Expressions.MethodCallExpression receiver, System.Collections.Generic.IEnumerable<System.Linq.Expressions.MemberBinding> bindings); or some variant.

For later reference, here's the WIP on enabling.

@jcouv jcouv reopened this Jun 12, 2020
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (iteration 1)

@jcouv jcouv merged commit 85b65a4 into dotnet:master Jun 15, 2020
@ghost ghost added this to the Next milestone Jun 15, 2020
@jcouv jcouv deleted the block-trees branch June 15, 2020 20:38
@dibarbet dibarbet modified the milestones: Next, 16.7.P4 Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants