~ubuntu-branches/ubuntu/vivid/monodevelop/vivid-proposed

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2014-10-09 14:09:23 UTC
  • mfrom: (10.3.5)
  • Revision ID: package-import@ubuntu.com-20141009140923-s0d22u5f9kg8jvds
Tags: 5.5.0.227-1
* [b2c8331] Imported Upstream version 5.5.0.227 (Closes: #754316)
* [d210995] Delete obsolete patches
* [1b59ae1] Clear patch fizz, via quilt refresh
* [3dd147d] Fix error in configure.in which applies for tarball builds but 
  not git builds when running autoreconf
* [21c2a57] Remove Metacity references for good
* [3331661] Ensure NUnit 2.6.3 is installed
* [fd85c88] Build-depend on NuGet
* [a1ae116] Add WebKit to build dependencies, for Xwt moduleref resolution
* [9b4cf12] Since the GDB addin is integrated now, declare it in 
  debian/control
* [6231562] Correct NUnit links
* [3d2b693] Fix NuGet addin, by copying libs locally
* [74bf9a8] Don't symlink unused Mocks NUnit assembly
* [ade52b2] Ensure IKVM.Reflection is built with default (4.5) profile

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        // This includes properties, indexers, and events
36
36
        public abstract class PropertyBasedMember : InterfaceMemberBase
37
37
        {
38
 
                public PropertyBasedMember (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, Attributes attrs)
 
38
                protected PropertyBasedMember (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, Attributes attrs)
39
39
                        : base (parent, type, mod, allowed_mod, name, attrs)
40
40
                {
41
41
                }
82
82
                        }
83
83
                }
84
84
 
 
85
                public abstract void PrepareEmit ();
 
86
 
85
87
                protected override bool VerifyClsCompliance ()
86
88
                {
87
89
                        if (!base.VerifyClsCompliance ())
174
176
                        return ps;
175
177
                }
176
178
 
177
 
                public override List<TypeSpec> ResolveMissingDependencies ()
 
179
                public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
178
180
                {
179
 
                        return memberType.ResolveMissingDependencies ();
 
181
                        return memberType.ResolveMissingDependencies (this);
180
182
                }
181
183
        }
182
184
 
197
199
                        {
198
200
                        }
199
201
 
200
 
                        public override MethodBuilder Define (TypeContainer parent)
 
202
                        public override void Define (TypeContainer parent)
201
203
                        {
202
204
                                base.Define (parent);
203
205
 
205
207
 
206
208
                                method_data = new MethodData (method, ModFlags, flags, this);
207
209
 
208
 
                                if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName)))
209
 
                                        return null;
210
 
 
211
 
                                method_data.DefineMethodBuilder (parent.PartialContainer, ParameterInfo);
212
 
 
213
 
                                return method_data.MethodBuilder;
 
210
                                method_data.Define (parent.PartialContainer, method.GetFullName (MemberName));
214
211
                        }
215
212
 
216
213
                        public override TypeSpec ReturnType {
262
259
                            }
263
260
                        }
264
261
 
265
 
                        public override MethodBuilder Define (TypeContainer parent)
 
262
                        public override void Define (TypeContainer parent)
266
263
                        {
267
264
                                parameters.Resolve (this);
268
265
                                
272
269
 
273
270
                                method_data = new MethodData (method, ModFlags, flags, this);
274
271
 
275
 
                                if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName)))
276
 
                                        return null;
277
 
 
278
 
                                method_data.DefineMethodBuilder (parent.PartialContainer, ParameterInfo);
279
 
 
280
 
                                return method_data.MethodBuilder;
 
272
                                method_data.Define (parent.PartialContainer, method.GetFullName (MemberName));
281
273
                        }
282
274
 
283
275
                        public override TypeSpec ReturnType {
334
326
                                return method.IsClsComplianceRequired ();
335
327
                        }
336
328
 
337
 
                        public virtual MethodBuilder Define (TypeContainer parent)
 
329
                        public virtual void Define (TypeContainer parent)
338
330
                        {
339
331
                                var container = parent.PartialContainer;
340
332
 
369
361
                                        if (Compiler.Settings.WriteMetadataOnly)
370
362
                                                block = null;
371
363
                                }
372
 
 
373
 
                                return null;
374
364
                        }
375
365
 
376
366
                        public bool HasCustomAccessModifier {
408
398
                PropertyMethod get, set, first;
409
399
                PropertyBuilder PropertyBuilder;
410
400
 
411
 
                public PropertyBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod_flags, Modifiers allowed_mod, MemberName name, Attributes attrs)
 
401
                protected PropertyBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod_flags, Modifiers allowed_mod, MemberName name, Attributes attrs)
412
402
                        : base (parent, type, mod_flags, allowed_mod, name, attrs)
413
403
                {
414
404
                }
522
512
                        // Check base property accessors conflict
523
513
                        //
524
514
                        var base_prop = (PropertySpec) base_member;
525
 
                        if (Get != null) {
 
515
                        if (Get == null) {
 
516
                                if ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasGet && !base_prop.Get.IsAccessible (this)) {
 
517
                                        // TODO: Should be different error code but csc uses for some reason same
 
518
                                        Report.SymbolRelatedToPreviousError (base_prop);
 
519
                                        Report.Error (545, Location,
 
520
                                                "`{0}': cannot override because `{1}' does not have accessible get accessor",
 
521
                                                GetSignatureForError (), base_prop.GetSignatureForError ());
 
522
                                        ok = false;
 
523
                                }
 
524
                        } else {
526
525
                                if (!base_prop.HasGet) {
527
526
                                        if (ok) {
528
527
                                                Report.SymbolRelatedToPreviousError (base_prop);
539
538
                                }
540
539
                        }
541
540
 
542
 
                        if (Set != null) {
 
541
                        if (Set == null) {
 
542
                                if ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasSet && !base_prop.Set.IsAccessible (this)) {
 
543
                                        // TODO: Should be different error code but csc uses for some reason same
 
544
                                        Report.SymbolRelatedToPreviousError (base_prop);
 
545
                                        Report.Error (546, Location,
 
546
                                                "`{0}': cannot override because `{1}' does not have accessible set accessor",
 
547
                                                GetSignatureForError (), base_prop.GetSignatureForError ());
 
548
                                        ok = false;
 
549
                                }
 
550
                        } else {
543
551
                                if (!base_prop.HasSet) {
544
552
                                        if (ok) {
545
553
                                                Report.SymbolRelatedToPreviousError (base_prop);
624
632
 
625
633
                        if (Get != null) {
626
634
                                spec.Get = Get.Spec;
627
 
 
628
 
                                var method = Get.Spec.GetMetaInfo () as MethodBuilder;
629
 
                                if (method != null) {
630
 
                                        PropertyBuilder.SetGetMethod (method);
631
 
                                        Parent.MemberCache.AddMember (this, method.Name, Get.Spec);
632
 
                                }
 
635
                                Parent.MemberCache.AddMember (this, Get.Spec.Name, Get.Spec);
633
636
                        } else {
634
637
                                CheckMissingAccessor (kind, parameters, true);
635
638
                        }
636
639
 
637
640
                        if (Set != null) {
638
641
                                spec.Set = Set.Spec;
639
 
 
640
 
                                var method = Set.Spec.GetMetaInfo () as MethodBuilder;
641
 
                                if (method != null) {
642
 
                                        PropertyBuilder.SetSetMethod (method);
643
 
                                        Parent.MemberCache.AddMember (this, method.Name, Set.Spec);
644
 
                                }
 
642
                                Parent.MemberCache.AddMember (this, Set.Spec.Name, Set.Spec);
645
643
                        } else {
646
644
                                CheckMissingAccessor (kind, parameters, false);
647
645
                        }
681
679
                        }
682
680
                }
683
681
 
 
682
                public override void PrepareEmit ()
 
683
                {
 
684
                        AccessorFirst.PrepareEmit ();
 
685
                        if (AccessorSecond != null)
 
686
                                AccessorSecond.PrepareEmit ();
 
687
 
 
688
                        if (get != null) {
 
689
                                var method = Get.Spec.GetMetaInfo () as MethodBuilder;
 
690
                                if (method != null)
 
691
                                        PropertyBuilder.SetGetMethod (method);
 
692
                        }
 
693
 
 
694
                        if (set != null) {
 
695
                                var method = Set.Spec.GetMetaInfo () as MethodBuilder;
 
696
                                if (method != null)
 
697
                                        PropertyBuilder.SetSetMethod (method);
 
698
                        }
 
699
                }
 
700
 
684
701
                protected override void SetMemberName (MemberName new_name)
685
702
                {
686
703
                        base.SetMemberName (new_name);
714
731
                public sealed class BackingField : Field
715
732
                {
716
733
                        readonly Property property;
 
734
                        const Modifiers DefaultModifiers = Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | Modifiers.DEBUGGER_HIDDEN;
717
735
 
718
 
                        public BackingField (Property p)
719
 
                                : base (p.Parent, p.type_expr,
720
 
                                Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (p.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
 
736
                        public BackingField (Property p, bool readOnly)
 
737
                                : base (p.Parent, p.type_expr, DefaultModifiers | (p.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
721
738
                                new MemberName ("<" + p.GetFullName (p.MemberName) + ">k__BackingField", p.Location), null)
722
739
                        {
723
740
                                this.property = p;
 
741
                                if (readOnly)
 
742
                                        ModFlags |= Modifiers.READONLY;
724
743
                        }
725
744
 
726
745
                        public Property OriginalProperty {
735
754
                        }
736
755
                }
737
756
 
 
757
                static readonly string[] attribute_target_auto = new string[] { "property", "field" };
 
758
 
 
759
                Field backing_field;
 
760
 
738
761
                public Property (TypeDefinition parent, FullNamedExpression type, Modifiers mod,
739
762
                                 MemberName name, Attributes attrs)
740
763
                        : base (parent, type, mod,
745
768
                {
746
769
                }
747
770
 
 
771
                public Expression Initializer { get; set; }
 
772
 
748
773
                public override void Accept (StructuralVisitor visitor)
749
774
                {
750
775
                        visitor.Visit (this);
751
776
                }
752
 
                
 
777
 
 
778
                public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
 
779
                {
 
780
                        if (a.Target == AttributeTargets.Field) {
 
781
                                backing_field.ApplyAttributeBuilder (a, ctor, cdata, pa);
 
782
                                return;
 
783
                        }
 
784
 
 
785
                        base.ApplyAttributeBuilder (a, ctor, cdata, pa);
 
786
                }
753
787
 
754
788
                void CreateAutomaticProperty ()
755
789
                {
756
790
                        // Create backing field
757
 
                        Field field = new BackingField (this);
758
 
                        if (!field.Define ())
 
791
                        backing_field = new BackingField (this, Initializer != null && Set == null);
 
792
                        if (!backing_field.Define ())
759
793
                                return;
760
794
 
761
 
                        Parent.PartialContainer.Members.Add (field);
762
 
 
763
 
                        FieldExpr fe = new FieldExpr (field, Location);
764
 
                        if ((field.ModFlags & Modifiers.STATIC) == 0)
 
795
                        if (Initializer != null) {
 
796
                                backing_field.Initializer = Initializer;
 
797
                                Parent.RegisterFieldForInitialization (backing_field, new FieldInitializer (backing_field, Initializer, Location));
 
798
                                backing_field.ModFlags |= Modifiers.READONLY;
 
799
                        }
 
800
 
 
801
                        Parent.PartialContainer.Members.Add (backing_field);
 
802
 
 
803
                        FieldExpr fe = new FieldExpr (backing_field, Location);
 
804
                        if ((backing_field.ModFlags & Modifiers.STATIC) == 0)
765
805
                                fe.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location);
766
806
 
767
807
                        //
772
812
                        Get.Block = new ToplevelBlock (Compiler, ParametersCompiled.EmptyReadOnlyParameters, Location.Null);
773
813
                        Return r = new Return (fe, Get.Location);
774
814
                        Get.Block.AddStatement (r);
 
815
                        Get.ModFlags |= Modifiers.COMPILER_GENERATED;
775
816
 
776
817
                        // Create set block
777
 
                        Set.Block = new ToplevelBlock (Compiler, Set.ParameterInfo, Location.Null);
778
 
                        Assign a = new SimpleAssign (fe, new SimpleName ("value", Location.Null), Location.Null);
779
 
                        Set.Block.AddStatement (new StatementExpression (a, Set.Location));
780
 
                }
781
 
                
782
 
                public override bool Define ()
783
 
                {
784
 
                        if (!base.Define ())
785
 
                                return false;
786
 
 
787
 
                        flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;
788
 
 
789
 
                        if (!IsInterface && (ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0 &&
790
 
                                AccessorSecond != null && Get.Block == null && Set.Block == null) {
791
 
                                if (Compiler.Settings.Version <= LanguageVersion.ISO_2)
792
 
                                        Report.FeatureIsNotAvailable (Compiler, Location, "automatically implemented properties");
793
 
 
794
 
                                Get.ModFlags |= Modifiers.COMPILER_GENERATED;
 
818
                        if (Set != null) {
 
819
                                Set.Block = new ToplevelBlock (Compiler, Set.ParameterInfo, Location.Null);
 
820
                                Assign a = new SimpleAssign (fe, new SimpleName ("value", Location.Null), Location.Null);
 
821
                                Set.Block.AddStatement (new StatementExpression (a, Set.Location));
795
822
                                Set.ModFlags |= Modifiers.COMPILER_GENERATED;
 
823
                        }
 
824
                }
 
825
                
 
826
                public override bool Define ()
 
827
                {
 
828
                        if (!base.Define ())
 
829
                                return false;
 
830
 
 
831
                        flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;
 
832
 
 
833
                        bool auto = AccessorFirst.Block == null && (AccessorSecond == null || AccessorSecond.Block == null) &&
 
834
                                (ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0;
 
835
 
 
836
                        if (Initializer != null) {
 
837
                                if (!auto)
 
838
                                        Report.Error (8050, Location, "`{0}': Only auto-implemented properties can have initializers",
 
839
                                                GetSignatureForError ());
 
840
 
 
841
                                if (IsInterface)
 
842
                                        Report.Error (8053, Location, "`{0}': Properties inside interfaces cannot have initializers",
 
843
                                                GetSignatureForError ());
 
844
 
 
845
                                if (Compiler.Settings.Version < LanguageVersion.V_6)
 
846
                                        Report.FeatureIsNotAvailable (Compiler, Location, "auto-implemented property initializer");
 
847
                        }
 
848
 
 
849
                        if (auto) {
 
850
                                if (Get == null) {
 
851
                                        Report.Error (8052, Location, "Auto-implemented property `{0}' must have get accessor",
 
852
                                                GetSignatureForError ());
 
853
                                        return false;
 
854
                                }
 
855
 
 
856
                                if (Initializer == null && AccessorSecond == null) {
 
857
                                        Report.Error (8051, Location, "Auto-implemented property `{0}' must have set accessor or initializer",
 
858
                                                GetSignatureForError ());
 
859
                                }
 
860
 
 
861
                                if (Compiler.Settings.Version < LanguageVersion.V_3 && Initializer == null)
 
862
                                        Report.FeatureIsNotAvailable (Compiler, Location, "auto-implemented properties");
 
863
 
796
864
                                CreateAutomaticProperty ();
797
865
                        }
798
866
 
826
894
 
827
895
                        base.Emit ();
828
896
                }
 
897
 
 
898
                public override string[] ValidAttributeTargets {
 
899
                        get {
 
900
                                return Get != null && ((Get.ModFlags & Modifiers.COMPILER_GENERATED) != 0) ?
 
901
                                        attribute_target_auto : base.ValidAttributeTargets;
 
902
                        }
 
903
                }
829
904
        }
830
905
 
831
906
        /// <summary>
839
914
                        {
840
915
                        }
841
916
 
842
 
                        public override MethodBuilder Define (TypeContainer ds)
 
917
                        public override void Define (TypeContainer ds)
843
918
                        {
844
919
                                CheckAbstractAndExtern (block != null);
845
 
                                return base.Define (ds);
 
920
                                base.Define (ds);
846
921
                        }
847
922
                        
848
923
                        public override string GetSignatureForError ()
965
1040
                                        Location)));
966
1041
                                args.Add (new Argument (new LocalVariableReference (obj1, Location)));
967
1042
 
968
 
                                var cas = Module.PredefinedMembers.InterlockedCompareExchange_T.Resolve (Location);
969
 
                                if (cas == null)
970
 
                                        return;
971
 
 
972
 
                                body.AddStatement (new StatementExpression (new SimpleAssign (
973
 
                                        new LocalVariableReference (obj1, Location),
974
 
                                        new Invocation (MethodGroupExpr.CreatePredefined (cas, cas.DeclaringType, Location), args))));
 
1043
                                var cas = Module.PredefinedMembers.InterlockedCompareExchange_T.Get ();
 
1044
                                if (cas == null) {
 
1045
                                        if (Module.PredefinedMembers.MonitorEnter_v4.Get () != null || Module.PredefinedMembers.MonitorEnter.Get () != null) {
 
1046
                                                // Workaround for cripled (e.g. microframework) mscorlib without CompareExchange
 
1047
                                                body.AddStatement (new Lock (
 
1048
                                                        block.GetParameterReference (0, Location),
 
1049
                                                        new StatementExpression (new SimpleAssign (
 
1050
                                                                f_expr, args [1].Expr, Location), Location), Location));
 
1051
                                        } else {
 
1052
                                                Module.PredefinedMembers.InterlockedCompareExchange_T.Resolve (Location);
 
1053
                                        }
 
1054
                                } else {
 
1055
                                        body.AddStatement (new StatementExpression (new SimpleAssign (
 
1056
                                                new LocalVariableReference (obj1, Location),
 
1057
                                                new Invocation (MethodGroupExpr.CreatePredefined (cas, cas.DeclaringType, Location), args))));
 
1058
                                }
975
1059
                        }
976
1060
                }
977
1061
 
1089
1173
                                return false;
1090
1174
 
1091
1175
                        if (declarators != null) {
1092
 
                                if ((mod_flags_src & Modifiers.DEFAULT_ACCESS_MODIFER) != 0)
1093
 
                                        mod_flags_src &= ~(Modifiers.AccessibilityMask | Modifiers.DEFAULT_ACCESS_MODIFER);
 
1176
                                if ((mod_flags_src & Modifiers.DEFAULT_ACCESS_MODIFIER) != 0)
 
1177
                                        mod_flags_src &= ~(Modifiers.AccessibilityMask | Modifiers.DEFAULT_ACCESS_MODIFIER);
1094
1178
 
1095
1179
                                var t = new TypeExpression (MemberType, TypeExpression.Location);
1096
1180
                                foreach (var d in declarators) {
1109
1193
                                return true;
1110
1194
                        }
1111
1195
 
1112
 
                        if (Add.IsInterfaceImplementation)
1113
 
                                SetIsUsed ();
1114
 
 
1115
1196
                        backing_field = new Field (Parent,
1116
1197
                                new TypeExpression (MemberType, Location),
1117
1198
                                Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
1185
1266
                                return method.IsClsComplianceRequired ();
1186
1267
                        }
1187
1268
 
1188
 
                        public virtual MethodBuilder Define (TypeContainer parent)
 
1269
                        public virtual void Define (TypeContainer parent)
1189
1270
                        {
1190
1271
                                // Fill in already resolved event type to speed things up and
1191
1272
                                // avoid confusing duplicate errors
1196
1277
                                        method.flags | MethodAttributes.HideBySig | MethodAttributes.SpecialName, this);
1197
1278
 
1198
1279
                                if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName)))
1199
 
                                        return null;
1200
 
 
1201
 
                                method_data.DefineMethodBuilder (parent.PartialContainer, ParameterInfo);
 
1280
                                        return;
1202
1281
 
1203
1282
                                if (Compiler.Settings.WriteMetadataOnly)
1204
1283
                                        block = null;
1205
1284
 
1206
1285
                                Spec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, ParameterInfo, method.ModFlags);
1207
1286
                                Spec.IsAccessor = true;
1208
 
 
1209
 
                                return method_data.MethodBuilder;
1210
1287
                        }
1211
1288
 
1212
1289
                        public override TypeSpec ReturnType {
1220
1297
                                return method.GetAttributeObsolete ();
1221
1298
                        }
1222
1299
 
 
1300
                        public MethodData MethodData {
 
1301
                                get {
 
1302
                                        return method_data;
 
1303
                                }
 
1304
                        }
 
1305
 
1223
1306
                        public override string[] ValidAttributeTargets {
1224
1307
                                get {
1225
1308
                                        return attribute_targets;
1318
1401
                        //
1319
1402
                        // Now define the accessors
1320
1403
                        //
1321
 
                        var AddBuilder = Add.Define (Parent);
1322
 
                        if (AddBuilder == null)
1323
 
                                return false;
1324
 
 
1325
 
                        var RemoveBuilder = remove.Define (Parent);
1326
 
                        if (RemoveBuilder == null)
1327
 
                                return false;
 
1404
                        add.Define (Parent);
 
1405
                        remove.Define (Parent);
1328
1406
 
1329
1407
                        EventBuilder = Parent.TypeBuilder.DefineEvent (GetFullName (MemberName), EventAttributes.None, MemberType.GetMetaInfo ());
1330
 
                        EventBuilder.SetAddOnMethod (AddBuilder);
1331
 
                        EventBuilder.SetRemoveOnMethod (RemoveBuilder);
1332
1408
 
1333
1409
                        spec = new EventSpec (Parent.Definition, this, MemberType, ModFlags, Add.Spec, remove.Spec);
1334
1410
 
1335
1411
                        Parent.MemberCache.AddMember (this, GetFullName (MemberName), spec);
1336
 
                        Parent.MemberCache.AddMember (this, AddBuilder.Name, Add.Spec);
1337
 
                        Parent.MemberCache.AddMember (this, RemoveBuilder.Name, remove.Spec);
 
1412
                        Parent.MemberCache.AddMember (this, Add.Spec.Name, Add.Spec);
 
1413
                        Parent.MemberCache.AddMember (this, Remove.Spec.Name, remove.Spec);
1338
1414
 
1339
1415
                        return true;
1340
1416
                }
1356
1432
                        base.Emit ();
1357
1433
                }
1358
1434
 
 
1435
                public override void PrepareEmit ()
 
1436
                {
 
1437
                        add.PrepareEmit ();
 
1438
                        remove.PrepareEmit ();
 
1439
 
 
1440
                        EventBuilder.SetAddOnMethod (add.MethodData.MethodBuilder);
 
1441
                        EventBuilder.SetRemoveOnMethod (remove.MethodData.MethodBuilder);
 
1442
                }
 
1443
 
1359
1444
                public override void WriteDebugSymbol (MonoSymbolFile file)
1360
1445
                {
1361
1446
                        add.WriteDebugSymbol (file);
1427
1512
                        return es;
1428
1513
                }
1429
1514
 
1430
 
                public override List<TypeSpec> ResolveMissingDependencies ()
 
1515
                public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
1431
1516
                {
1432
 
                        return MemberType.ResolveMissingDependencies ();
 
1517
                        return MemberType.ResolveMissingDependencies (this);
1433
1518
                }
1434
1519
        }
1435
1520
 
1445
1530
                                this.parameters = parameters;
1446
1531
                        }
1447
1532
 
1448
 
                        public override MethodBuilder Define (TypeContainer parent)
 
1533
                        public override void Define (TypeContainer parent)
1449
1534
                        {
1450
1535
                                // Disable reporting, parameters are resolved twice
1451
1536
                                Report.DisableReporting ();
1455
1540
                                        Report.EnableReporting ();
1456
1541
                                }
1457
1542
 
1458
 
                                return base.Define (parent);
 
1543
                                base.Define (parent);
1459
1544
                        }
1460
1545
 
1461
1546
                        public override ParametersCompiled ParameterInfo {
1701
1786
                        return spec;
1702
1787
                }
1703
1788
 
1704
 
                public override List<TypeSpec> ResolveMissingDependencies ()
 
1789
                public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
1705
1790
                {
1706
 
                        var missing = base.ResolveMissingDependencies ();
 
1791
                        var missing = base.ResolveMissingDependencies (caller);
 
1792
 
1707
1793
                        foreach (var pt in parameters.Types) {
1708
 
                                var m = pt.GetMissingDependencies ();
 
1794
                                var m = pt.GetMissingDependencies (caller);
1709
1795
                                if (m == null)
1710
1796
                                        continue;
1711
1797
 
1712
1798
                                if (missing == null)
1713
 
                                        missing = new List<TypeSpec> ();
 
1799
                                        missing = new List<MissingTypeSpecReference> ();
1714
1800
 
1715
1801
                                missing.AddRange (m);
1716
1802
                        }