[Mono-bugs] [Bug 27287][Maj] New - Error while casting a struct to an interface

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
1 Jul 2002 12:02:30 -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 jaime@geneura.ugr.es.

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

--- shadow/27287	Mon Jul  1 08:02:30 2002
+++ shadow/27287.tmp.2769	Mon Jul  1 08:02:30 2002
@@ -0,0 +1,51 @@
+Bug#: 27287
+Product: Mono/MCS
+Version: unspecified
+OS: Red Hat 7.3
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jaime@geneura.ugr.es               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error while casting a struct to an interface
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+> I got a compiler error telling that I cannot convert a struct to an
+> interface through casting. The struct actually implements the 
+> interface
+> and I try to cast it directly (although the 'as' way doesn't work
+> neither): 
+> 
+> ISomeInterface isObject = (ISomeInterface) isObject;
+> 
+
+
+
+
+Steps to reproduce the problem:
+1. Try to do a casting from a struct to an interface that the struct
+implements. 
+
+Actual Results:
+You cannot cast.
+
+Expected Results:
+I should have an instance of the interface which is the struct instance
+casted to the interface.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+
+More info on mono-list. Ask me for source code for testing this if you want.