-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Expression trees support for tuples. #12897
Comments
which status on this? |
What is preventing this from being implemented via Option 1? |
Any news about this 4 years old proposal? |
Nope. No news. |
Is this being worked on? |
No. It is not being worked on. See #12897 (comment) |
@CyrusNajmabadi Are you sure? dotnet/csharplang#4727 links this very thread. |
This seems to be working:
|
@qsdfplkj Those are standard method invocations though. This issue proposes tuples on a language level within expression trees. |
So using the valuetuple is a good alternative? |
Yes, if you want to construct a tuple within the available Expression Trees (as of C# 10). creating a tuple via a method call is a good alternative to |
We should consider supporting expressions with tuples in expression tree lambdas.
It can be done either by
Option 1 is more desirable since it is more expressive, but will require introducing new nodes, possibly as a reducible layer on top of the standard ET nodes.
Option 2 could run into problems where tuple conversions require temporaries and in the ET version (1.0) those are not available.
It may be possible to use member bindings to avoid this problem, but it is not completely clear if that is possible and it will require that tuple conversion lowering in a context of expression trees to be significantly different.
Option 1 seems more attractive to me at the moment.
The text was updated successfully, but these errors were encountered: