[Mono-bugs] [Bug 32443][Nor] Changed - Assembly.LoadFrom ("gizmo.dll").CreateInstance ("gizmo").GetType().FullName allways returns System.Object and not a gizmo.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
25 Nov 2002 16:51:04 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gkodinov@openlinksw.co.uk.

http://bugzilla.ximian.com/show_bug.cgi?id=32443

--- shadow/32443	Mon Nov 18 11:55:28 2002
+++ shadow/32443.tmp.30084	Mon Nov 25 11:51:04 2002
@@ -1,13 +1,13 @@
 Bug#: 32443
 Product: Mono/Runtime
 Version: unspecified
 OS: Red Hat 7.0
 OS Details: 
-Status: RESOLVED   
-Resolution: FIXED
+Status: REOPENED   
+Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: gkodinov@openlinksw.co.uk               
 QAContact: mono-bugs@ximian.com
@@ -48,6 +48,31 @@
 InternalInvoke and the only info it gets is the method desc, so it uses 
 it to call mono_object_new.
 
 ------- Additional Comments From lupus@ximian.com  2002-11-18 11:55 -------
 Fixed in cvs. We noe throw an exception if the constructor is not
 found, just like it happens with the ms runtime.
+
+------- Additional Comments From gkodinov@openlinksw.co.uk  2002-11-25 11:51 -------
+Well, In MS.NET implementation it actually works !
+The logic behind it (as I understand it) is:
+By definition gizmo inherits System.Object.
+So the above definition for gizmo becomes:
+class gizmo : System.Object
+{
+...
+}
+
+Since System.Object has a default zero-parameter public constructor 
+it get's inherited by the gizmo object.
+So :
+new gizmo() should be fully valid operation (and should return an 
+istance of the gizmo object, witch in itself is an instance of 
+System.Object, but <instance>.GetType() would return gizmo even if 
+the object was constructed by the System.Object constructor.
+
+As a result the above code should not generate an error (as I've 
+noted it does now) but should somehow make a new gizmo instance.
+
+I'm not persisting this for academic reasons - it's totally relevant 
+for process of deserializing object instances - there it can and 
+will call only the default (no params) constructor.