[mcs] When setting struct empty layout consider compiler generated fields. Fixes...
[mono.git] / mcs / mcs / property.cs
index 6b1990e1f0983d87bd8b91d0f60dee7efe51129c..5d831e940b523b144287c7e0d47f0394e3677147 100644 (file)
@@ -820,8 +820,10 @@ namespace Mono.CSharp
                        Parent.PartialContainer.Members.Add (BackingField);
 
                        FieldExpr fe = new FieldExpr (BackingField, Location);
-                       if ((BackingField.ModFlags & Modifiers.STATIC) == 0)
+                       if ((BackingField.ModFlags & Modifiers.STATIC) == 0) {
                                fe.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location);
+                               Parent.PartialContainer.HasInstanceField = true;
+                       }
 
                        //
                        // Create get block but we careful with location to