Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Kumpera <kumpera@gmail.com>2010-04-20 23:29:34 +0400
committerRodrigo Kumpera <kumpera@gmail.com>2010-04-20 23:29:34 +0400
commit736df07e26d73e625460a7a52518157bd295d32d (patch)
tree7fbe46119edbef734b03f45ba87c638cc5d4cd70 /mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
parent417844ad07e97e327d6f26a36a1e33cccb3dbcb4 (diff)
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 svn path=/trunk/mcs/; revision=155832
Diffstat (limited to 'mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs')
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
index 1358079b578..0a7be28f12e 100644
--- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
@@ -766,6 +766,15 @@ namespace System.Reflection.Emit
}
}
+ //
+ // 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.");
@@ -783,19 +792,11 @@ namespace System.Reflection.Emit
}
}
- //
- // 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;
@@ -1648,7 +1649,7 @@ namespace System.Reflection.Emit
internal bool is_created {
get {
- return created != null;
+ return createTypeCalled;
}
}