What is the longest legal statement block you can make with only C# keywords?

后端 未结 8 1427
粉色の甜心
粉色の甜心 2020-12-28 16:39

I was writing some code in C#, and I found myself writing:

return new MyClass(...

when I noticed that both the return and the

8条回答
  •  伪装坚强ぢ
    2020-12-28 17:31

    One more variant with method definition (found by my colleague):

    protected internal override sealed unsafe async void await() { ... }
    

    Makes 8 keywords in a row. Uses the fact that await is a contextual keyword, so it can be reused for method name.

提交回复
热议问题