+ //
+ // Needed to delay hoisted _this_ initialization. When an anonymous
+ // method is used inside ctor and _this_ is hoisted, base ctor has to
+ // be called first, otherwise _this_ will be initialized with
+ // uninitialized value.
+ //
+ sealed class ThisInitializer : Statement
+ {
+ readonly HoistedThis hoisted_this;
+
+ public ThisInitializer (HoistedThis hoisted_this)
+ {
+ this.hoisted_this = hoisted_this;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ hoisted_this.EmitHoistingAssignment (ec);
+ }
+
+ protected override void CloneTo (CloneContext clonectx, Statement target)
+ {
+ // Nothing to clone
+ }
+
+ public override void MutateHoistedGenericType (AnonymousMethodStorey storey)
+ {
+ // Nothing to mutate
+ }
+ }
+