As you saw earlier, the code for a static field initializer executes inside an implicit type constructor.
正如您在前面看到的那样,静态字段初始值设定项的代码在隐式类型构造函数的内部执行。
Whenever a particular type is required, the initializer for that type is transparently lifted into the type itself.
每当需要一个特殊类型时,该类型的初始化器就很明显地被提升成类型本身。
The second scenario is when a type has a initializer for a static field, in which case the compiler adds a type constructor behind the scenes.
第二种情况是,类型具有一个用于静态字段的初始值设定项,在这种情况下,编译器会在后台添加类型构造函数。
应用推荐