using System.Collections.Generic;
using System.Threading.Tasks;
using static DotNext.Metaprogramming.CodeGenerator;
public static async Task Main()
var result = AsyncLambda<Func<IAsyncEnumerable<char>, Task>>(fun =>
AwaitForEach(fun[0], ch =>
await result(GetData('1'));
public static async IAsyncEnumerable<char> GetData(char data)
throw new Exception("Expected exception");