[Mono-bugs] [Bug 52486][Blo] New - Using at runtime generated enum's (with Reflection Emit) not possible

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 23 Dec 2003 11:30:17 -0500 (EST)


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 dominic_ullmann@hispeed.ch.

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

--- shadow/52486	2003-12-23 11:30:17.000000000 -0500
+++ shadow/52486.tmp.1641	2003-12-23 11:30:17.000000000 -0500
@@ -0,0 +1,54 @@
+Bug#: 52486
+Product: Mono/Class Libraries
+Version: unspecified
+OS: SuSE 8.1
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dominic_ullmann@hispeed.ch               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Using at runtime generated enum's (with Reflection Emit) not possible
+
+Description of Problem:
+
+An enum gnerated at runtime with Reflection.Emit is not usable (before the 
+assembly has been saved to disk).
+
+After instantiating an enum, trying to print out the value results in the 
+following crash:
+** ERROR **: file metadata.c: line 909 (mono_metadata_decode_row_col): 
+assertion failed: (col < mono_metadata_table_count (bitfield))
+aborting...
+Aborted
+
+And trying to cast the enum to an int leads to the following exception:
+System.InvalidCastException: Cannot cast from source type to destination 
+type
+
+
+Steps to reproduce the problem:
+1. Compile and run the attachted file Test.cs
+
+Actual Results:
+- crash:
+
+** ERROR **: file metadata.c: line 909 (mono_metadata_decode_row_col): 
+assertion failed: (col < mono_metadata_table_count (bitfield))
+aborting...
+Aborted
+
+Expected Results:
+The demo should not crash. 
+It does work with csc/Microsoft.NET.
+
+How often does this happen? 
+every time.
+
+Additional Information: