+
+ protected override bool CheckBase (TypeContainer container)
+ {
+ base.CheckBase (container);
+
+ // Check whether arguments were correct.
+ if (!DoDefineParameters ())
+ return false;
+
+ if ((ModFlags & Modifiers.STATIC) != 0)
+ return true;
+
+ if (container is Struct && ParameterTypes.Length == 0) {
+ Report.Error (568, Location,
+ "Structs can not contain explicit parameterless " +
+ "constructors");
+ return false;
+ }
+
+ //
+ // Check in our class for dups
+ //
+ ArrayList ar = container.InstanceConstructors;
+
+ // I don't think this is possible (there should be
+ // at least one, us). However, just in case:
+ if (ar == null)
+ return true;
+
+ int arLen = ar.Count;
+ for (int i = 0; i < arLen; i++) {
+ Constructor m = (Constructor) ar [i];
+
+ //
+ // Check for a ctor with identical args
+ //
+ if (m == this || m.ConstructorBuilder == null || m.ParameterTypes.Length != ParameterTypes.Length)
+ continue;