dotnet/roslyn

Main Method warnings are ignored if "main type" is specified

開放

#18,964 建立於 2017年4月24日

 (9 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-CompilersBugConcept-Diagnostic Clarityhelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

In the CSharp entrypoint finder warnings that would otherwise be reported are simply ignored if a Main Type is provided to the compiler.

Example

static class Program {
    static void Main<T>() { }
    static void Main(string[] args) { }
}

compiling with csc /main:Program repro.cs produces no errors or diagnostics

compiling with csc repro.cs gives you:

repro.cs(2,17): warning CS0402: 'Program.Main<T>()': an entry point cannot be generic or in a generic type

貢獻者指南