[Mono-bugs] [Bug 74734][Nor] New - [PATCH] mono not able to handle typeref to a nested class in the same assembly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 26 Apr 2005 06:52:13 -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 radical@gmail.com.

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

--- shadow/74734	2005-04-26 06:52:13.000000000 -0400
+++ shadow/74734.tmp.9328	2005-04-26 06:52:13.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 74734
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: radical@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] mono not able to handle typeref to a nested class in the same assembly
+
+Attached is a test case and the patch.
+
+ilasm'ing the test-case on .net and trying to run under mono gives:
+
+$ mono n.exe 
+
+** ERROR **: pending init .abc
+
+aborting...
+Aborted
+
+$ monodis n.exe 
+.assembly extern mscorlib
+{
+  .ver 1:0:5000:0
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+}
+.assembly 'n'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+.module n.exe // GUID = {BCFB3BB1-33A0-402B-A81D-B0CE2B07417C}
+
+
+  .class public auto ansi beforefieldinit abc
+        extends [mscorlib]System.Object
+  {
+
+** ERROR **: pending init .abc
+
+aborting...
+Aborted
+
+-----------------------------------------------
+
+Basically, .net is emitting a TypeRef for a nested type which is referenced
+before it is defined, even though it is in the same assembly. This is valid
+so it should be handled by mono.
+
+The same .il compiled with our ilasm emits the correct TypeDef.