Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# 4.0 Compiler Crash

This code sample is not able to be compiled. Any work arounds out there?

using System; using System.Collections.Generic; using System.Linq; using System.Text;  namespace ConsoleApplication1 {     using church = Func<dynamic, dynamic, dynamic>;      class Program     {         static void Main(string[] args)         {             church True = (a, b) => a;             church False = (a, b) => b;              Func<church, church, church> And = (x, y) => x(y(True, False), False);         }     } } 

Error 6 Internal Compiler Error (0xc0000005 at address 5476A4CC): likely culprit is 'EMITIL'. An internal error has occurred in the compiler. To work around this problem, try simplifying or changing the program near the locations listed below. Locations at the top of the list are closer to the point at which the internal error occurred. Errors such as this can be reported to Microsoft by using the /errorreport option. TestApplication

like image 201
Michael J. Gray Avatar asked Oct 25 '11 19:10

Michael J. Gray


1 Answers

Clearly that is a compiler bug.

I mentioned this to one of our testers and he says:

I’m happy to report that this has already been fixed and you’ll see this fix in the next version of VS. You’ll actually see it fixed in the BUILD Developer Preview for Visual Studio as well!

Apologies for the error, and thanks for bringing this to our attention.

like image 69
Eric Lippert Avatar answered Oct 13 '22 17:10

Eric Lippert