开发者

how does a c sharp compiler work when a function from the system namespace is called?

how does a c sharp compiler work when a function from any pre-defined namespace is called? I have mentioned System namespace just a开发者_如何学运维s an instance.


The same as it does for any other namespace. There is no magic here.

There are some hard-coded things in the compiler, for example:

  • the type aliases int/string etc which are merely aliases to global::System.Int32 etc
  • the expression tree compiler is, AFAIK, hard-coded to System.Linq.Expressions.Expression (but is also not cited in the spec, so a bit of an edge-case)
  • some magic in the interop namespaces (for calling constructors on interfaces, etc)

But mostly... it is just classes etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜