[Mono-bugs] [Bug 74933][Blo] Changed - IsInstanceOf failure (?)
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Fri, 13 May 2005 05:32:33 -0400 (EDT)
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 michael@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74933
--- shadow/74933 2005-05-13 05:21:09.000000000 -0400
+++ shadow/74933.tmp.14101 2005-05-13 05:32:33.000000000 -0400
@@ -1,14 +1,14 @@
Bug#: 74933
Product: Mono: Runtime
Version: 1.1
-OS:
+OS: unknown
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Blocker
Component: misc
AssignedTo: martin@ximian.com
ReportedBy: michael@ximian.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
@@ -100,6 +100,31 @@
may be the issue - but ...
The problem here is that we try to see if it is assignable, but we do a
generic type comparison - (not always true) - instead of a per instance
comparison.
At least - that's my guess so far ;-)
+
+------- Additional Comments From michael@ximian.com 2005-05-13 05:32 -------
+ok - so with this (trivial) patch, life is good for me:
+
+--- class/corlib/System.Reflection/Binder.cs (revision 44425)
++++ class/corlib/System.Reflection/Binder.cs (working copy)
+@@ -170,15 +172,21 @@
+ Type vtype = value.GetType ();
+ if (type.IsByRef)
+ type = type.GetElementType ();
+- if (vtype == type || type.IsAssignableFrom (vtype))
++ if (vtype == type || type.IsInstanceOfType (value))
+ return value;
+ if (vtype.IsArray && type.IsArray){
+ if (IsArrayAssignable (vtype.GetElementType (),
+type.GetElementType ()))
+ return value;
+ }
+
+Of course - given that this is broken - it's highly likely that this
+meta-problem is spread all over the code :-) someone should audit it
+for it & write a nice test ...
+
+With this fix, the 1st UNO factory instance activates itself & passes
+the 1st (rather facile) in-process test :-)