Created attachment 16513 [details]
Example solution causing the crash, including the Build Output log
Using Xamarin Studio 6.0.1 (build 9), up to date from the Stable channel, we were unable to build due to this error:
/Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/4.5/Microsoft.CSharp.targets: error : Compiler crashed with code: 1.
The problem turned out to be caused by this code pattern:
Data += await GetHello () + "!\n" + 123.ToString () + "...";
For this to crash the compiler, Data must be a property, 123.ToString() cannot be a string literal, and both the string literals must be there in that pattern. Code following this pattern built fine in Visual Studio.
Here is the exception from the build output (where line 16 is the beginning of the function containing that code pattern):
Mono.CSharp.InternalErrorException: Program.cs(16,9): CompilerCrash.MainClass.<Demo>c__async0.MoveNext() ---> Mono.CSharp.InternalErrorException: (1,1): ---> Mono.CSharp.InternalErrorException: Await yields with non-empty stack in `CompilerCrash.MainClass.<Demo>c__async0.MoveNext()
at Mono.CSharp.EmitContext.AssertEmptyStack () <0x24e0350 + 0x000cc> in <filename unknown>:0
Program.cs and BuiltOutput.log are attached, providing a full example.
I verified this happens in both Xamarin.iOS and Console projects.
Fixed in master and Mono 4.6