Does C# allow double semicolon ; ; if so, are there any special ways?

后端 未结 7 1698
盖世英雄少女心
盖世英雄少女心 2020-11-29 12:18

I am writing a statement and it compiles, but the compiler [VS] never tells me that I put the semicolon two times.

This means in ASP.NET MVC 3

return         


        
7条回答
  •  无人及你
    2020-11-29 12:38

    No, a double semi-colon is never required. I'm slightly surprised that the compiler doesn't complain that it's an unreachable statement, but apparently it's legal. It won't do any harm, but equally it's not a good idea.

提交回复
热议问题