2 // interface.cs: Interface handler
4 // Author: Miguel de Icaza (miguel@gnu.org)
6 // Licensed under the terms of the GNU GPL
8 // (C) 2001 Ximian, Inc (http://www.ximian.com)
11 using System.Collections;
14 using System.Reflection;
15 using System.Reflection.Emit;
17 namespace Mono.CSharp {
22 public class Interface : DeclSpace, IMemberContainer {
23 const MethodAttributes interface_method_attributes =
24 MethodAttributes.Public |
25 MethodAttributes.Abstract |
26 MethodAttributes.HideBySig |
27 MethodAttributes.NewSlot |
28 MethodAttributes.Virtual;
30 const MethodAttributes property_attributes =
31 MethodAttributes.Public |
32 MethodAttributes.Abstract |
33 MethodAttributes.HideBySig |
34 MethodAttributes.NewSlot |
35 MethodAttributes.SpecialName |
36 MethodAttributes.Virtual;
40 ArrayList defined_method;
41 ArrayList defined_indexer;
42 ArrayList defined_events;
43 ArrayList defined_properties;
45 ArrayList method_builders;
46 ArrayList property_builders;
47 ArrayList event_builders;
50 public string IndexerName;
52 IMemberContainer parent_container;
53 MemberCache member_cache;
57 // These will happen after the semantic analysis
59 // Hashtable defined_indexers;
60 // Hashtable defined_methods;
63 /// Modifiers allowed in a class declaration
65 public const int AllowedModifiers =
73 public Interface (NamespaceEntry ns, TypeContainer parent, string name, int mod,
74 Attributes attrs, Location l)
75 : base (ns, parent, name, attrs, l)
77 ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
79 method_builders = new ArrayList ();
80 property_builders = new ArrayList ();
81 event_builders = new ArrayList ();
84 public AdditionResult AddMethod (InterfaceMethod imethod)
86 string name = imethod.Name;
87 Object value = defined_names [name];
90 if (!(value is InterfaceMethod))
91 return AdditionResult.NameExists;
94 if (defined_method == null)
95 defined_method = new ArrayList ();
97 defined_method.Add (imethod);
99 DefineName (name, imethod);
101 return AdditionResult.Success;
104 public AdditionResult AddProperty (InterfaceProperty iprop)
107 string name = iprop.Name;
109 if ((res = IsValid (name, name)) != AdditionResult.Success)
112 DefineName (name, iprop);
114 if (defined_properties == null)
115 defined_properties = new ArrayList ();
117 defined_properties.Add (iprop);
118 return AdditionResult.Success;
121 public AdditionResult AddEvent (InterfaceEvent ievent)
123 string name = ievent.Name;
126 if ((res = IsValid (name, name)) != AdditionResult.Success)
129 DefineName (name, ievent);
131 if (defined_events == null)
132 defined_events = new ArrayList ();
134 defined_events.Add (ievent);
135 return AdditionResult.Success;
138 public bool AddIndexer (InterfaceIndexer iindexer)
140 if (defined_indexer == null)
141 defined_indexer = new ArrayList ();
143 defined_indexer.Add (iindexer);
147 public ArrayList InterfaceMethods {
149 return defined_method;
153 public ArrayList InterfaceProperties {
155 return defined_properties;
159 public ArrayList InterfaceEvents {
161 return defined_events;
165 public ArrayList InterfaceIndexers {
167 return defined_indexer;
171 public ArrayList Bases {
181 public virtual TypeAttributes InterfaceAttr {
183 TypeAttributes x = TypeAttributes.Interface | TypeAttributes.Abstract;
185 if (IsTopLevel == false) {
187 if ((ModFlags & Modifiers.PROTECTED) != 0
188 && (ModFlags & Modifiers.INTERNAL) != 0)
189 x |= TypeAttributes.NestedFamORAssem;
190 else if ((ModFlags & Modifiers.PROTECTED) != 0)
191 x |= TypeAttributes.NestedFamily;
192 else if ((ModFlags & Modifiers.INTERNAL) != 0)
193 x |= TypeAttributes.NestedAssembly;
194 else if ((ModFlags & Modifiers.PUBLIC) != 0)
195 x |= TypeAttributes.NestedPublic;
197 x |= TypeAttributes.NestedPrivate;
199 if ((ModFlags & Modifiers.PUBLIC) != 0)
200 x |= TypeAttributes.Public;
201 else if ((ModFlags & Modifiers.PRIVATE) != 0)
202 x |= TypeAttributes.NotPublic;
205 if ((ModFlags & Modifiers.ABSTRACT) != 0)
206 x |= TypeAttributes.Abstract;
208 if ((ModFlags & Modifiers.SEALED) != 0)
209 x |= TypeAttributes.Sealed;
215 void Error111 (InterfaceMemberBase ib)
219 "Interface `" + Name + "' already contains a definition with the " +
220 "same return value and parameter types for member `" + ib.Name + "'");
223 bool RegisterMethod (MethodBase mb, InternalParameters ip, Type [] types)
225 if (!TypeManager.RegisterMethod (mb, ip, types))
228 method_builders.Add (mb);
233 // This might trigger a definition of the methods. This happens only
234 // with Attributes, as Attribute classes are processed before interfaces.
235 // Ideally, we should make everything just define recursively in terms
236 // of its dependencies.
238 public MethodInfo [] GetMethods (TypeContainer container)
242 if (!members_defined){
243 if (DefineMembers (container))
244 n = method_builders.Count;
246 n = method_builders.Count;
248 MethodInfo [] mi = new MethodInfo [n];
250 method_builders.CopyTo (mi, 0);
255 // Hack around System.Reflection as found everywhere else
256 public override MemberList FindMembers (MemberTypes mt, BindingFlags bf,
257 MemberFilter filter, object criteria)
259 ArrayList members = new ArrayList ();
261 if ((mt & MemberTypes.Method) != 0) {
262 foreach (MethodBuilder mb in method_builders)
263 if (filter (mb, criteria))
267 if ((mt & MemberTypes.Property) != 0) {
268 foreach (PropertyBuilder pb in property_builders)
269 if (filter (pb, criteria))
273 if ((mt & MemberTypes.Event) != 0) {
274 foreach (MyEventBuilder eb in event_builders)
275 if (filter (eb, criteria))
279 if (((bf & BindingFlags.DeclaredOnly) == 0) && (TypeBuilder.BaseType != null)) {
280 MemberList parent_mi;
282 parent_mi = TypeContainer.FindMembers (
283 TypeBuilder.BaseType, mt, bf, filter, criteria);
285 members.AddRange (parent_mi);
288 return new MemberList (members);
291 public override MemberCache MemberCache {
298 // Populates the methods in the interface
300 void PopulateMethod (TypeContainer parent, DeclSpace decl_space, InterfaceMethod im)
302 if (im.ReturnType == null)
305 Type return_type = im.ReturnType.Type;
306 if (return_type == null)
307 return_type = this.ResolveType (im.ReturnType, false, im.Location);
309 Type [] arg_types = im.ParameterTypes (this);
312 if (return_type == null)
315 if (return_type.IsPointer && !UnsafeOK (this))
318 if (arg_types == null)
321 foreach (Type t in arg_types){
326 if (t.IsPointer && !UnsafeOK (this))
333 mb = TypeBuilder.DefineMethod (
334 im.Name, interface_method_attributes,
335 return_type, arg_types);
337 InternalParameters ip = new InternalParameters (arg_types, im.Parameters);
339 if (!RegisterMethod (mb, ip, arg_types)) {
345 // Labelling of parameters is taken care of
346 // during the Emit phase via
347 // MethodCore.LabelParameters method so I am
348 // removing the old code here.
356 // Populates the properties in the interface
358 void PopulateProperty (TypeContainer parent, DeclSpace decl_space, InterfaceProperty ip)
362 ip.Type = this.ResolveTypeExpr (ip.Type, false, ip.Location);
366 Type prop_type = ip.Type.Type;
367 Type [] setter_args = new Type [1];
369 if (prop_type == null)
372 if (prop_type.IsPointer && !UnsafeOK (this))
375 setter_args [0] = prop_type;
378 // FIXME: properties are missing the following
379 // flags: hidebysig newslot specialname
381 pb = TypeBuilder.DefineProperty (
382 ip.Name, PropertyAttributes.None,
385 MethodBuilder get = null, set = null;
388 get = TypeBuilder.DefineMethod (
389 "get_" + ip.Name, property_attributes ,
393 // HACK because System.Reflection.Emit is lame
395 Type [] null_types = null;
396 InternalParameters inp = new InternalParameters
397 (null_types, Parameters.EmptyReadOnlyParameters);
399 if (!RegisterMethod (get, inp, null)) {
404 pb.SetGetMethod (get);
408 setter_args [0] = prop_type;
410 set = TypeBuilder.DefineMethod (
411 "set_" + ip.Name, property_attributes,
412 TypeManager.void_type, setter_args);
414 set.DefineParameter (1, ParameterAttributes.None, "value");
415 pb.SetSetMethod (set);
418 // HACK because System.Reflection.Emit is lame
420 Parameter [] parms = new Parameter [1];
421 parms [0] = new Parameter (ip.Type, "value", Parameter.Modifier.NONE, null);
422 InternalParameters ipp = new InternalParameters (
423 this, new Parameters (parms, null, Location.Null));
425 if (!RegisterMethod (set, ipp, setter_args)) {
431 TypeManager.RegisterProperty (pb, get, set);
432 property_builders.Add (pb);
439 // Populates the events in the interface
441 void PopulateEvent (TypeContainer parent, DeclSpace decl_space, InterfaceEvent ie)
444 // FIXME: We need to do this after delegates have been
445 // declared or we declare them recursively.
448 MethodBuilder add = null, remove = null;
449 ie.Type = this.ResolveTypeExpr (ie.Type, false, ie.Location);
453 Type event_type = ie.Type.Type;
455 if (event_type == null)
458 if (event_type.IsPointer && !UnsafeOK (this))
461 Type [] parameters = new Type [1];
462 parameters [0] = event_type;
464 eb = new MyEventBuilder (null, TypeBuilder, ie.Name,
465 EventAttributes.None, event_type);
468 // Now define the accessors
470 string add_name = "add_" + ie.Name;
472 add = TypeBuilder.DefineMethod (
473 add_name, property_attributes, null, parameters);
474 add.DefineParameter (1, ParameterAttributes.None, "value");
475 eb.SetAddOnMethod (add);
477 string remove_name = "remove_" + ie.Name;
478 remove = TypeBuilder.DefineMethod (
479 remove_name, property_attributes, null, parameters);
480 remove.DefineParameter (1, ParameterAttributes.None, "value");
481 eb.SetRemoveOnMethod (remove);
483 Parameter [] parms = new Parameter [1];
484 parms [0] = new Parameter (ie.Type, "value", Parameter.Modifier.NONE, null);
485 InternalParameters ip = new InternalParameters (
486 this, new Parameters (parms, null, Location.Null));
488 if (!RegisterMethod (add, ip, parameters)) {
493 if (!RegisterMethod (remove, ip, parameters)) {
498 TypeManager.RegisterEvent (eb, add, remove);
499 event_builders.Add (eb);
505 // Populates the indexers in the interface
507 void PopulateIndexer (TypeContainer parent, DeclSpace decl_space, InterfaceIndexer ii)
510 ii.Type = this.ResolveTypeExpr (ii.Type, false, ii.Location);
514 Type prop_type = ii.Type.Type;
515 Type [] arg_types = ii.ParameterTypes (this);
516 Type [] value_arg_types;
518 if (prop_type == null)
521 if (prop_type.IsPointer && !UnsafeOK (this))
525 // Sets up the extra invisible `value' argument for setters.
527 if (arg_types != null){
528 int count = arg_types.Length;
529 value_arg_types = new Type [count + 1];
531 arg_types.CopyTo (value_arg_types, 0);
532 value_arg_types [count] = prop_type;
534 foreach (Type t in arg_types){
535 if (t.IsPointer && !UnsafeOK (this))
539 value_arg_types = new Type [1];
541 value_arg_types [1] = prop_type;
544 EmitContext ec = new EmitContext (parent, decl_space, Location, null,
545 null, ModFlags, false);
547 IndexerName = Attribute.ScanForIndexerName (ec, ii.OptAttributes);
548 if (IndexerName == null)
549 IndexerName = "Item";
551 pb = TypeBuilder.DefineProperty (
552 IndexerName, PropertyAttributes.None,
553 prop_type, arg_types);
555 MethodBuilder set_item = null, get_item = null;
557 Parameter [] p = ii.Parameters.FixedParameters;
559 get_item = TypeBuilder.DefineMethod (
560 "get_" + IndexerName, property_attributes,
561 prop_type, arg_types);
562 pb.SetGetMethod (get_item);
564 // HACK because System.Reflection.Emit is lame
566 InternalParameters ip = new InternalParameters (
567 arg_types, ii.Parameters);
569 if (!RegisterMethod (get_item, ip, arg_types)) {
575 for (int i = 0; i < p.Length; i++)
576 get_item.DefineParameter (
578 p [i].Attributes, p [i].Name);
583 Parameter [] p = ii.Parameters.FixedParameters;
587 pv = new Parameter [p.Length + 1];
589 pv [p.Length] = new Parameter (ii.Type, "value", Parameter.Modifier.NONE, null);
590 Parameters value_params = new Parameters (pv, null, Location.Null);
591 value_params.GetParameterInfo (decl_space);
593 set_item = TypeBuilder.DefineMethod (
594 "set_" + IndexerName, property_attributes,
595 TypeManager.void_type, value_arg_types);
596 pb.SetSetMethod (set_item);
598 // HACK because System.Reflection.Emit is lame
600 InternalParameters ip = new InternalParameters (
601 value_arg_types, value_params);
602 if (!RegisterMethod (set_item, ip, value_arg_types)) {
608 for (; i < p.Length; i++)
609 set_item.DefineParameter (
611 p [i].Attributes, p [i].Name);
614 set_item.DefineParameter (i + 1, ParameterAttributes.None, "value");
617 property_builders.Add (pb);
620 ii.GetBuilder = get_item;
621 ii.SetBuilder = set_item;
625 /// Performs the semantic analysis for all the interface members
626 /// that were declared
628 bool SemanticAnalysis ()
630 Hashtable methods = new Hashtable ();
633 if (defined_method != null){
634 foreach (InterfaceMethod im in defined_method){
635 string sig = im.GetSignature (this);
638 // If there was an undefined Type on the signatures
643 if (methods [sig] != null){
651 // FIXME: Here I should check i
656 TypeExpr GetInterfaceTypeByName (string name)
658 Type t = FindType (Location, name);
661 Report.Error (246, Location, "The type or namespace `" + name +
662 "' could not be found");
667 return new TypeExpression (t, Location);
672 cause = "is a struct";
674 cause = "is a class";
676 cause = "Should not happen.";
678 Report.Error (527, Location, "`"+name+"' " + cause +
679 ", need an interface instead");
685 // Returns the list of interfaces that this interface implements
686 // Or null if it does not implement any interface.
688 // Sets the error boolean accoringly.
690 TypeExpr [] GetInterfaceBases (out bool error)
699 tbases = new TypeExpr [Bases.Count];
702 foreach (string name in Bases){
705 t = GetInterfaceTypeByName (name);
711 if (!t.AsAccessible (Parent, ModFlags))
712 Report.Error (61, Location,
713 "Inconsistent accessibility: base interface `" +
714 t.Name + "' is less accessible than interface `" +
720 return TypeManager.ExpandInterfaces (tbases);
725 // Defines the Interface in the appropriate ModuleBuilder or TypeBuilder
729 // Rework the way we recurse, because for recursive
730 // definitions of interfaces (A:B and B:A) we report the
731 // error twice, rather than once.
733 public override TypeBuilder DefineType ()
738 if (TypeBuilder != null)
746 EmitContext ec = new EmitContext (this, this, Location, null, null,
749 ifaces = GetInterfaceBases (out error);
755 if (TypeManager.NamespaceClash (Name, Location))
758 ModuleBuilder builder = CodeGen.ModuleBuilder;
760 TypeBuilder = builder.DefineType (
763 (Type)null, // Parent Type
765 RootContext.RegisterOrder (this);
767 TypeBuilder builder = Parent.TypeBuilder;
769 TypeBuilder = builder.DefineNestedType (
772 (Type) null, //parent type
775 TypeContainer tc = TypeManager.LookupTypeContainer (builder);
776 tc.RegisterOrder (this);
779 if (ifaces != null) {
780 foreach (TypeExpr iface in ifaces) {
781 Type itype = iface.ResolveType (ec);
782 TypeBuilder.AddInterfaceImplementation (itype);
786 TypeManager.AddUserInterface (Name, TypeBuilder, this, ifaces);
793 // Defines the indexers, and also verifies that the IndexerNameAttribute in the
794 // interface is consistent. Either it is `Item' or it is the name defined by all the
795 // indexers with the `IndexerName' attribute.
797 // Turns out that the IndexerNameAttribute is applied to each indexer,
798 // but it is never emitted, instead a DefaultName attribute is attached
801 void DefineIndexers (TypeContainer parent)
803 string interface_indexer_name = null;
805 foreach (InterfaceIndexer ii in defined_indexer){
807 PopulateIndexer (parent, this, ii);
809 if (interface_indexer_name == null){
810 interface_indexer_name = IndexerName;
814 if (IndexerName == interface_indexer_name)
818 668, "Two indexers have different names, " +
819 " you should use the same name for all your indexers");
821 if (interface_indexer_name == null)
822 interface_indexer_name = "Item";
823 IndexerName = interface_indexer_name;
827 /// Performs semantic analysis, and then generates the IL interfaces
829 public override bool DefineMembers (TypeContainer parent)
834 if (!SemanticAnalysis ())
838 if (defined_method != null){
839 foreach (InterfaceMethod im in defined_method)
840 PopulateMethod (parent, this, im);
843 if (defined_properties != null){
844 foreach (InterfaceProperty ip in defined_properties)
845 PopulateProperty (parent, this, ip);
848 if (defined_events != null)
849 foreach (InterfaceEvent ie in defined_events)
850 PopulateEvent (parent, this, ie);
852 if (defined_indexer != null) {
853 DefineIndexers (parent);
855 CustomAttributeBuilder cb = EmitDefaultMemberAttr (
856 parent, IndexerName, ModFlags, Location);
858 TypeBuilder.SetCustomAttribute (cb);
862 if (TypeBuilder.BaseType != null)
863 parent_container = TypeManager.LookupMemberContainer (TypeBuilder.BaseType);
865 member_cache = new MemberCache (this);
867 members_defined = true;
873 // In the case of Interfaces, there is nothing to do here
875 public override bool Define (TypeContainer parent)
881 /// Applies all the attributes.
883 public void Emit (TypeContainer tc)
885 if (OptAttributes != null) {
886 EmitContext ec = new EmitContext (tc, this, Location, null, null,
888 Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes);
891 // Now emit attributes for each interface member
892 if (defined_method != null) {
893 foreach (InterfaceMethod im in defined_method) {
894 EmitContext ec = new EmitContext (tc, this, Location, null,
895 im.ReturnType.Type, ModFlags, false);
897 MethodCore.LabelParameters (ec, im.Builder,
902 if (im.OptAttributes != null)
903 Attribute.ApplyAttributes (ec, im.Builder,
904 im, im.OptAttributes);
909 if (defined_properties != null) {
910 foreach (InterfaceProperty ip in defined_properties) {
911 EmitContext ec = new EmitContext (tc, this, Location, null,
912 null, ModFlags, false);
914 if (ip.OptAttributes != null)
915 Attribute.ApplyAttributes (ec, ip.Builder, ip, ip.OptAttributes);
917 if (ip.GetAttributes != null)
918 Attribute.ApplyAttributes (ec, ip.GetBuilder, ip, ip.GetAttributes);
920 if (ip.SetAttributes != null)
921 Attribute.ApplyAttributes (ec, ip.SetBuilder, ip, ip.SetAttributes);
925 if (defined_events != null) {
926 foreach (InterfaceEvent ie in defined_events) {
927 EmitContext ec = new EmitContext (tc, this, Location, null,
928 null, ModFlags, false);
930 if (ie.OptAttributes != null)
931 Attribute.ApplyAttributes (ec, ie.Builder, ie, ie.OptAttributes);
935 if (defined_indexer != null) {
936 foreach (InterfaceIndexer ii in defined_indexer) {
937 EmitContext ec = new EmitContext (tc, this, Location, null,
938 null, ModFlags, false);
940 if (ii.OptAttributes != null)
941 Attribute.ApplyAttributes (ec, ii.Builder, ii, ii.OptAttributes);
943 if (ii.GetAttributes != null)
944 Attribute.ApplyAttributes (ec, ii.GetBuilder, ii, ii.GetAttributes);
946 if (ii.SetAttributes != null)
947 Attribute.ApplyAttributes (ec, ii.SetBuilder, ii, ii.SetAttributes);
952 public static CustomAttributeBuilder EmitDefaultMemberAttr (TypeContainer parent,
957 EmitContext ec = new EmitContext (parent, loc, null, null, flags);
959 Expression ml = Expression.MemberLookup (ec, TypeManager.default_member_type,
960 ".ctor", MemberTypes.Constructor,
961 BindingFlags.Public | BindingFlags.Instance,
964 MethodGroupExpr mg = (MethodGroupExpr) ml;
966 MethodBase constructor = mg.Methods [0];
968 string [] vals = { name };
970 CustomAttributeBuilder cb = null;
972 cb = new CustomAttributeBuilder ((ConstructorInfo) constructor, vals);
974 Report.Warning (-100, "Can not set the indexer default member attribute");
984 string IMemberContainer.Name {
990 Type IMemberContainer.Type {
996 IMemberContainer IMemberContainer.Parent {
998 return parent_container;
1002 MemberCache IMemberContainer.MemberCache {
1004 return member_cache;
1008 bool IMemberContainer.IsInterface {
1014 MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf)
1016 // Interfaces only contain instance members.
1017 if ((bf & BindingFlags.Instance) == 0)
1018 return MemberList.Empty;
1019 if ((bf & BindingFlags.Public) == 0)
1020 return MemberList.Empty;
1022 ArrayList members = new ArrayList ();
1024 if ((mt & MemberTypes.Method) != 0)
1025 members.AddRange (method_builders);
1027 if ((mt & MemberTypes.Property) != 0)
1028 members.AddRange (property_builders);
1030 if ((mt & MemberTypes.Event) != 0)
1031 members.AddRange (event_builders);
1033 return new MemberList (members);
1037 public class InterfaceMemberBase {
1038 public readonly string Name;
1039 public readonly bool IsNew;
1040 public Attributes OptAttributes;
1042 public InterfaceMemberBase (string name, bool is_new, Attributes attrs)
1046 OptAttributes = attrs;
1050 public class InterfaceProperty : InterfaceMemberBase {
1051 public readonly bool HasSet;
1052 public readonly bool HasGet;
1053 public readonly Location Location;
1054 public Expression Type;
1055 public PropertyBuilder Builder;
1056 public MethodBuilder GetBuilder;
1057 public MethodBuilder SetBuilder;
1058 public Attributes GetAttributes;
1059 public Attributes SetAttributes;
1061 public InterfaceProperty (Expression type, string name,
1062 bool is_new, bool has_get, bool has_set,
1063 Attributes prop_attrs, Attributes get_attrs,
1064 Attributes set_attrs, Location loc)
1065 : base (name, is_new, prop_attrs)
1070 GetAttributes = get_attrs;
1071 SetAttributes = set_attrs;
1076 public class InterfaceEvent : InterfaceMemberBase {
1077 public readonly Location Location;
1078 public Expression Type;
1079 public MyEventBuilder Builder;
1081 public InterfaceEvent (Expression type, string name, bool is_new, Attributes attrs,
1083 : base (name, is_new, attrs)
1090 public class InterfaceMethod : InterfaceMemberBase {
1091 public Expression ReturnType;
1092 public readonly Parameters Parameters;
1093 public readonly Location Location;
1094 public MethodBuilder Builder;
1096 public InterfaceMethod (Expression return_type, string name, bool is_new, Parameters args,
1097 Attributes attrs, Location l)
1098 : base (name, is_new, attrs)
1100 this.ReturnType = return_type;
1101 this.Parameters = args;
1106 /// Returns the signature for this interface method
1108 public string GetSignature (DeclSpace ds)
1110 ReturnType = ds.ResolveTypeExpr (ReturnType, false, Location);
1111 if (ReturnType == null)
1114 Type ret = ReturnType.Type;
1115 string args = Parameters.GetSignature (ds);
1117 if ((ret == null) || (args == null))
1120 return (IsNew ? "new-" : "") + ret.FullName + "(" + args + ")";
1123 public Type [] ParameterTypes (DeclSpace ds)
1125 return Parameters.GetParameterInfo (ds);
1129 public class InterfaceIndexer : InterfaceMemberBase {
1130 public readonly bool HasGet, HasSet;
1131 public readonly Parameters Parameters;
1132 public readonly Location Location;
1133 public Expression Type;
1134 public PropertyBuilder Builder;
1135 public MethodBuilder GetBuilder;
1136 public MethodBuilder SetBuilder;
1137 public Attributes GetAttributes;
1138 public Attributes SetAttributes;
1140 public InterfaceIndexer (Expression type, Parameters args, bool do_get, bool do_set,
1141 bool is_new, Attributes attrs,
1142 Attributes get_attrs, Attributes set_attrs,
1144 : base ("", is_new, attrs)
1150 GetAttributes = get_attrs;
1151 SetAttributes = set_attrs;
1155 public Type [] ParameterTypes (DeclSpace ds)
1157 return Parameters.GetParameterInfo (ds);