IndentedTextWriter Async Fail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Foo | |
Bar | |
Quux | |
Wibble |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment