X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fproperty.cs;h=3478711470a0fa6d93b668621c5d60392e2fda08;hb=34866ac4c20c781f10c40fe6f6fe0c39733fd946;hp=8036f2c1126a56319198464e021386325110ca10;hpb=c6c9631e1b076f512517d54d058e11fcf1904e91;p=mono.git diff --git a/mcs/mcs/property.cs b/mcs/mcs/property.cs index 8036f2c1126..3478711470a 100644 --- a/mcs/mcs/property.cs +++ b/mcs/mcs/property.cs @@ -680,6 +680,10 @@ namespace Mono.CSharp Module.PredefinedAttributes.Dynamic.EmitAttribute (PropertyBuilder, member_type, Location); } + if (member_type.HasNamedTupleElement) { + Module.PredefinedAttributes.TupleElementNames.EmitAttribute (PropertyBuilder, member_type, Location); + } + ConstraintChecker.Check (this, member_type, type_expr.Location); first.Emit (Parent); @@ -820,8 +824,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 @@ -873,6 +879,11 @@ namespace Mono.CSharp return false; } + if (MemberType.Kind == MemberKind.ByRef) { + Report.Error (8145, Location, "Auto-implemented properties cannot return by reference"); + return false; + } + if (Compiler.Settings.Version < LanguageVersion.V_3 && Initializer == null) Report.FeatureIsNotAvailable (Compiler, Location, "auto-implemented properties"); @@ -1210,12 +1221,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 (); @@ -1792,6 +1802,18 @@ namespace Mono.CSharp } #endregion + public static ParametersImported CreateParametersFromSetter (MethodSpec setter, int set_param_count) + { + // + // Creates indexer parameters based on setter method parameters (the last parameter has to be removed) + // + var data = new IParameterData [set_param_count]; + var types = new TypeSpec [set_param_count]; + Array.Copy (setter.Parameters.FixedParameters, data, set_param_count); + Array.Copy (setter.Parameters.Types, types, set_param_count); + return new ParametersImported (data, types, setter.Parameters.HasParams); + } + public override string GetSignatureForDocumentation () { return base.GetSignatureForDocumentation () + parameters.GetSignatureForDocumentation ();