Allow yield to return type by convention #4726
Unanswered
NN---
asked this question in
Language Ideas
Replies: 1 comment
-
How would the compiler know how to generate code for these types? |
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.
-
Currently yield requires you to return IEnumerable or IEnumerator.
It is not possible to return a derived Interface or return my own type.
Use case,
interface IRefEnumerable { ref T Current{get;} bool MoveNext(); }
I could yield return with this type if it was allowed.
Beta Was this translation helpful? Give feedback.
All reactions