C# 4.0 Compiler Crash

后端 未结 4 2025
不知归路
不知归路 2021-02-04 23:52

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;

n         


        
4条回答
  •  暖寄归人
    2021-02-05 00:16

    EDIT: I've now managed to reproduce it, and I have a potential workaround.

    This works:

    csc Test.cs
    

    This doesn't:

    csc /debug+ Test.cs
    

    So it looks like it's a problem with the debug information. If you can live without that in your particular scenario, you're good to go...

    EDIT: I've just tested, and this happens with /debug:pdbonly as well...

    EDIT: Just in case anyone was wondering, I'll ping Eric Lippert about this.

    EDIT: This is now the minimal repro I've found:

    using church = System.Func;
    
    class Program
    {
        static void Main() {}
    }
    

提交回复
热议问题