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

Allow TryExpression inside a filter? #20083

Open
JonHanna opened this issue Feb 2, 2017 · 3 comments
Open

Allow TryExpression inside a filter? #20083

JonHanna opened this issue Feb 2, 2017 · 3 comments

Comments

@JonHanna
Copy link
Contributor

JonHanna commented Feb 2, 2017

Compiling a TryExpression that is inside the Filter expression of a CatchBlock of another TryExpression throws with the IL compiler (the interpreter has no problem with it).

This is reasonable since if it produced such IL it would be unverifiable.

It is however a limit on composability; a method producing bool-typed expressions may in good faith use a TryExpression within it while a method producing CatchBlocks may in good faith use such an expression in a filter. The failure comes from the combination of two reasonable operations.

Branching to outside of the filter won't work, as that is also unverifiable.

Emitting a method for the closure of the filter expression and locals it uses, and calling that method as a new filter expression would work.

@karelz
Copy link
Member

karelz commented Feb 2, 2017

@JonHanna it would help me a bit if you hint in future in the issues you file, if they are about Linq or Linq.Expressions, so that I can help set the labels correctly (not that they matter too much as both are owned by the same folks, but if we have them, let's use them properly :))
Thanks!

@JonHanna
Copy link
Contributor Author

JonHanna commented Feb 2, 2017

@karelz sure. This one is Linq.Expressions, btw.

@karelz
Copy link
Member

karelz commented Feb 2, 2017

@JonHanna :) ... and I thought I made the right guess, thanks!

@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

5 participants