[Mono-bugs] [Bug 33532][Cos] Changed - NullReferenceException when using params with inproper casts

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
9 Nov 2002 17:45: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 mathias.hasselmann@gmx.de.

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

--- shadow/33532	Sat Nov  9 12:29:48 2002
+++ shadow/33532.tmp.17431	Sat Nov  9 12:45:30 2002
@@ -2,13 +2,13 @@
 Product: Mono/MCS
 Version: unspecified
 OS: Red Hat 7.3
 OS Details: kernel 2.4.20-pre10acpi20021002
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Cosmetic
 Component: Misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: mathias.hasselmann@gmx.de               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -25,6 +25,31 @@
     static void TriggerTheBug(params JValue[] args) {}
     public static void Main() { TriggerTheBug(23); }
 }
 
 Expected behaviour would be an error message expressing that there is no
 implicit conversion from "int" to "JValue".
+
+------- Additional Comments From mathias.hasselmann@gmx.de  2002-11-09 12:45 -------
+Problem also occurs if an implicit cast operator is added to JValue:
+
+class TestCase
+{
+    public struct JValue 
+    { 
+        int val; 
+        public JValue(int i) { this.val = i; }
+	public static implicit operator JValue(int i) { return new JValue(i); }
+    }
+    static void TriggerTheBug(params JValue[] args) {}
+    public static void Main() { TriggerTheBug(23); }
+}
+
+It disappears if 
+
+    public static void Main() { TriggerTheBug(23); }
+
+is replaced by
+
+    public static void Main() { TriggerTheBug(new JValue(23)); }
+
+