+2010-04-20 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * TypeBuilder.cs (CreateType): Move default constructor
+ and createTypeCalled assignment to before the parent checks.
+
+ * TypeBuilder.cs (is_created): Return true even if creation
+ fails.
+
+ Fixes #331126
+
2010-04-09 Rodrigo Kumpera <rkumpera@novell.com>
* TypeBuilder.cs (IsValueTypeImpl): Don't depend on
}
}
+ //
+ // On classes, define a default constructor if not provided
+ //
+ if (!(IsInterface || IsValueType) && (ctors == null) && (tname != "<Module>") &&
+ (GetAttributeFlagsImpl () & TypeAttributes.Abstract | TypeAttributes.Sealed) != (TypeAttributes.Abstract | TypeAttributes.Sealed) && !has_ctor_method ())
+ DefineDefaultConstructor (MethodAttributes.Public);
+
+ createTypeCalled = true;
+
if ((parent != null) && parent.IsSealed)
throw new TypeLoadException ("Could not load type '" + FullName + "' from assembly '" + Assembly + "' because the parent type is sealed.");
}
}
- //
- // On classes, define a default constructor if not provided
- //
- if (!(IsInterface || IsValueType) && (ctors == null) && (tname != "<Module>") &&
- (GetAttributeFlagsImpl () & TypeAttributes.Abstract | TypeAttributes.Sealed) != (TypeAttributes.Abstract | TypeAttributes.Sealed) && !has_ctor_method ())
- DefineDefaultConstructor (MethodAttributes.Public);
-
if (ctors != null){
foreach (ConstructorBuilder ctor in ctors)
ctor.fixup ();
}
- createTypeCalled = true;
created = create_runtime_class (this);
if (created != null)
return created;
internal bool is_created {
get {
- return created != null;
+ return createTypeCalled;
}
}