params collections in C#13 and error CS4007 #8600
Unanswered
Aniobodo
asked this question in
Language Ideas
Replies: 2 comments 1 reply
-
Not if you want to use a generated iterator. You need either evaluate everything up front, and return all the results at once, or pay for the search patterns alloe. Imo, you're already paying for the iterator allocation, so the additional memory for the patterns really isn't much more. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Error CS4007 is thrown at build time for the method above. The message implies that the instance of the type “System.ReadOnlySpan” cannot be retained beyond the limits “await” or “yield”.
This is a serious limitation on the params collections feature of C# 13.
So, I wonder if there is a safe way out of the limitation.
Beta Was this translation helpful? Give feedback.
All reactions