码迷,mamicode.com
首页 > Windows程序 > 详细

C# to IL 4 Keywords and Operators(关键字和操作符)

时间:2017-04-11 12:58:25      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:within   write   exe   ever   font   counter   pre   min   because   

Code that is placed after the return statement never gets executed. In the first program
given below, you will notice that there is a WriteLine function call in C# but is not visible in
our IL code. This is because the compiler is aware that any statements after return is not
executed and hence, it serves no purpose to convert it into IL.

技术分享

技术分享

The compiler does not waste time compiling code that will never get executed, instead
generates a warning when it encounters such a situation.

技术分享

技术分享

技术分享

If a constructor is not present in the source code, a constructor with no parameters gets
generated. If a constructor is present, the one with no parameters is eliminated from the
code.
The base class constructor always gets called without any parameters and it gets called
first. The above IL code proves this fact.

 技术分享

技术分享

技术分享

We may write a namespace within a namespace, but the compiler converts it all into one
namespace in the IL file. Thus, the two namespaces vijay and mukhi in the C# file get
merged into a single namespace vijay.mukhi in the IL file.

C# to IL 4 Keywords and Operators(关键字和操作符)

标签:within   write   exe   ever   font   counter   pre   min   because   

原文地址:http://www.cnblogs.com/revoid/p/6692998.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!