X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fproperty.cs;h=5d831e940b523b144287c7e0d47f0394e3677147;hb=a0fc3f4dcf571edc997f53066c09671650e96670;hp=7d95e44efdb433bcd01ea8229d9b719af3b86099;hpb=bcb651443de098171a4e71a71d7f21a599323a4f;p=mono.git diff --git a/mcs/mcs/property.cs b/mcs/mcs/property.cs index 7d95e44efdb..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 @@ -82,8 +82,6 @@ namespace Mono.CSharp } } - public abstract void PrepareEmit (); - protected override bool VerifyClsCompliance () { if (!base.VerifyClsCompliance ()) @@ -246,7 +244,7 @@ namespace Mono.CSharp protected override void ApplyToExtraTarget (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa) { if (a.Target == AttributeTargets.Parameter) { - parameters[0].ApplyAttributeBuilder (a, ctor, cdata, pa); + parameters[parameters.Count - 1].ApplyAttributeBuilder (a, ctor, cdata, pa); return; } @@ -619,8 +617,7 @@ namespace Mono.CSharp GetSignatureForError ()); } } else if ((ModFlags & Modifiers.OVERRIDE) == 0 && - (Get == null && (Set.ModFlags & Modifiers.AccessibilityMask) != 0) || - (Set == null && (Get.ModFlags & Modifiers.AccessibilityMask) != 0)) { + ((Get == null && (Set.ModFlags & Modifiers.AccessibilityMask) != 0) || (Set == null && (Get.ModFlags & Modifiers.AccessibilityMask) != 0))) { Report.Error (276, Location, "`{0}': accessibility modifiers on accessors may only be used if the property or indexer has both a get and a set accessor", GetSignatureForError ()); @@ -823,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 @@ -904,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 ()); @@ -1213,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 (); @@ -1452,6 +1450,8 @@ namespace Mono.CSharp public override void PrepareEmit () { + base.PrepareEmit (); + add.PrepareEmit (); remove.PrepareEmit (); @@ -1761,9 +1761,8 @@ namespace Mono.CSharp public override void PrepareEmit () { - parameters.ResolveDefaultValues (this); - base.PrepareEmit (); + parameters.ResolveDefaultValues (this); } protected override bool VerifyClsCompliance ()