Closed fanoI closed 4 years ago
Having this simply IEnumerable function:
static IEnumerable<Command> RegisterAllCommands() { yield return new Echo(); yield return new Help(); }
If I simply call it:
RegisterAllCommands();
I get Stack Overflow exception, a normal Net Core application does little better simply blocks as the IEnumerable is not evalutated.
Doing instead a simple empty foreach (I know I cannot call .ToList() / .ToArray() as that will be a call to a Linq method):
foreach (var c in RegisterAllCommands()) { }
I get this error from IL2CPU itself that make the compilation fail:
Error Exception: System.ArgumentException: 'this' type cannot be an interface itself
Having this simply IEnumerable function:
If I simply call it:
I get Stack Overflow exception, a normal Net Core application does little better simply blocks as the IEnumerable is not evalutated.
Doing instead a simple empty foreach (I know I cannot call .ToList() / .ToArray() as that will be a call to a Linq method):
I get this error from IL2CPU itself that make the compilation fail: