Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IndentedTextWriter Async Fail
using System.CodeDom.Compiler;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace IndentFail
{
class Program
{
static async Task Main(string[] args)
{
var sb = new StringBuilder();
var sw = new StringWriter(sb);
var tw = new IndentedTextWriter(sw);
tw.Indent++;
await tw.WriteLineAsync("Foo");
await tw.WriteLineAsync("Bar");
await tw.WriteLineAsync();
await tw.WriteLineAsync("Quux");
await tw.WriteLineAsync("Wibble");
System.Console.WriteLine(sb.ToString());
}
}
}
Foo
Bar
Quux
Wibble
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.