[Mono-bugs] [Bug 45876][Nor] New - Attributes on operators are specified twice in the MSIL

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 6 Jul 2003 09:37:25 -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 jc@manoli.net.

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

--- shadow/45876	Sun Jul  6 09:37:25 2003
+++ shadow/45876.tmp.18456	Sun Jul  6 09:37:25 2003
@@ -0,0 +1,80 @@
+Bug#: 45876
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: Windows XP SP1
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jc@manoli.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Attributes on operators are specified twice in the MSIL
+
+Description of Problem:
+
+When an attribute is specified on an operator, MCS includes it twice in 
+the MSIL code.
+
+
+Steps to reproduce the problem:
+
+1. Compile the following class with MCS:
+
+public class BrowsableClass
+{
+    [EditorBrowsable(EditorBrowsableState.Always)]
+    public static BrowsableClass operator ++(BrowsableClass a) 
+    { 
+        return null; 
+    }
+}
+
+2. Disassemble the assembly.
+
+3. See that the EditorBrowsable attribute is listed twice.
+
+
+Actual Results:
+
+.method public hidebysig specialname static 
+        class NDoc.Test.EditorBrowsableAttr.BrowsableClass 
+        op_Increment(class NDoc.Test.EditorBrowsableAttr.BrowsableClass 
+a) cil managed
+{
+  .custom instance void [System]
+System.ComponentModel.EditorBrowsableAttribute::.ctor(valuetype [System]
+System.ComponentModel.EditorBrowsableState) = ( 01 00 00 00 00 00 00 00 ) 
+  .custom instance void [System]
+System.ComponentModel.EditorBrowsableAttribute::.ctor(valuetype [System]
+System.ComponentModel.EditorBrowsableState) = ( 01 00 00 00 00 00 00 00 ) 
+  // Code size       2 (0x2)
+  .maxstack  8
+  IL_0000:  ldnull
+  IL_0001:  ret
+} // end of method BrowsableClass::op_Increment
+
+
+Expected Results:
+
+.method public hidebysig specialname static 
+        class NDoc.Test.EditorBrowsableAttr.BrowsableClass 
+        op_Increment(class NDoc.Test.EditorBrowsableAttr.BrowsableClass 
+a) cil managed
+{
+  .custom instance void [System]
+System.ComponentModel.EditorBrowsableAttribute::.ctor(valuetype [System]
+System.ComponentModel.EditorBrowsableState) = ( 01 00 00 00 00 00 00 00 ) 
+  // Code size       2 (0x2)
+  .maxstack  8
+  IL_0000:  ldnull
+  IL_0001:  ret
+} // end of method BrowsableClass::op_Increment
+
+
+How often does this happen?  Always