How can global function exist in C#?

前端 未结 7 1522
暖寄归人
暖寄归人 2020-12-29 05:58

How can global function exist in C# when everything is defined inside a class? I was reading the documentation of OpCodes.Call at MSDN, and was surprised to see the followin

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 06:32

    Because System.Reflection.Emit.OpCodes.Call isn't about C#. It's about emitting IL opcodes. In IL, there are features that are not available in C#. Global functions is one of those features.

提交回复
热议问题