X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fproperty.cs;h=5d831e940b523b144287c7e0d47f0394e3677147;hb=a0fc3f4dcf571edc997f53066c09671650e96670;hp=cdd1d15172598491583019f1d437a8d4d7d7517d;hpb=226af94a2345f88d3170823646e1c25a276ba281;p=mono.git diff --git a/mcs/mcs/property.cs b/mcs/mcs/property.cs index cdd1d151725..5d831e940b5 100644 --- a/mcs/mcs/property.cs +++ b/mcs/mcs/property.cs @@ -17,7 +17,7 @@ using System.Collections.Generic; using System.Text; using Mono.CompilerServices.SymbolWriter; -#if NET_2_1 +#if MOBILE using XmlElement = System.Object; #endif @@ -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 @@ -901,7 +903,7 @@ namespace Mono.CSharp public override void Emit () { - if ((AccessorFirst.ModFlags & (Modifiers.STATIC | Modifiers.COMPILER_GENERATED)) == Modifiers.COMPILER_GENERATED && Parent.PartialContainer.HasExplicitLayout) { + if ((AccessorFirst.ModFlags & (Modifiers.STATIC | Modifiers.AutoProperty)) == Modifiers.AutoProperty && Parent.PartialContainer.HasExplicitLayout) { Report.Error (842, Location, "Automatically implemented property `{0}' cannot be used inside a type with an explicit StructLayout attribute", GetSignatureForError ()); @@ -1210,12 +1212,11 @@ namespace Mono.CSharp backing_field = new Field (Parent, new TypeExpression (MemberType, Location), - Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)), + Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.DEBUGGER_HIDDEN | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)), MemberName, null); Parent.PartialContainer.Members.Add (backing_field); backing_field.Initializer = Initializer; - backing_field.ModFlags &= ~Modifiers.COMPILER_GENERATED; // Call define because we passed fields definition backing_field.Define ();