I reproduced the crash using VS2010 (WinXP 64).
Two workarounds:
1. do not use using alias
The following code compiles on VS2010:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Func<dynamic, dynamic, dynamic> True = (a, b) => a; Func<dynamic, dynamic, dynamic> False = (a, b) => b; Func<Func<dynamic, dynamic, dynamic>, Func<dynamic, dynamic, dynamic>, Func<dynamic, dynamic, dynamic> > And = (x, y) => x(y(True, False), False); } } }
2. use the Mono compiler
No problem with the Mono 2.10 compiler (dmcs).
[mono] /tmp @ dmcs test.cs test.cs(18,42): warning CS0219: The variable `And' is assigned but its value is never used Compilation succeeded - 1 warning(s) [mono] /tmp @ ./test.exe [mono] /tmp @
This has been tested on Linux.
- You can run executable files created using mono in Windows.NET.
- The monocompiler comes with an MSI installer and runs on Windows.
sehe Oct 25 '11 at 19:22 2011-10-25 19:22
source share