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

Expression.Convert and Expression.ConvertChecked should support tuple conversions. #21073

Open
JonHanna opened this issue Apr 12, 2017 · 0 comments

Comments

@JonHanna
Copy link
Contributor

Currently the code:

Expression.Convert(Expression.Constant((1, 1)), typeof((long, long)))

Throws an InvalidOperationException with the message

"No coercion operator is defined between types 'System.ValueTuple`2[System.Int32,System.Int32]' and 'System.ValueTuple`2[System.Int64,System.Int64]'."

As such conversions are now among the standard conversions one expects to work with the main .NET languages, they should work with S.L.Expressions too.

As well as being of value in itself, this will facilitate #20753 as then MS.CSharp can be changed to recognise when such conversions are relevant and create the relevant Linq expression, and would be at least beneficial to dotnet/roslyn#12897

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@cston cston removed the untriaged New issue has not been triaged by the area owner label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants