Skip to content

Disallow 'with' in expression trees#45095

Merged
jcouv merged 3 commits intodotnet:masterfrom
jcouv:block-trees
Jun 15, 2020
Merged

Disallow 'with' in expression trees#45095
jcouv merged 3 commits intodotnet:masterfrom
jcouv:block-trees

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