[Mono-bugs] [Bug 76453][Blo] New - exception at class field assignment with automatic conversion

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Oct 16 13:53:54 EDT 2005

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 tobias.kaes at gmx.de.


--- shadow/76453	2005-10-16 13:53:54.000000000 -0400
+++ shadow/76453.tmp.7391	2005-10-16 13:53:54.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 76453
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Blocker
+Component: VB Runtime
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: tobias.kaes at gmx.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: exception at class field assignment with automatic conversion
+Description of Problem:
+Exception with code which runs correctly under microsoft-net
+Code to reproduce the problem:
+module root
+ class t
+  public v as byte
+ end class
+ sub main()
+  dim o as object = new t
+  o.v = 0
+ end sub
+end module
+Actual Results:
+System.ArgumentException: Object type System.Int32 cannot be converted to
+target type: System.Byte
+Parameter name: val
+in <0x0016f> System.Reflection.MonoField:SetValue (System.Object obj,
+System.Object val, BindingFlags invokeAttr, System.Reflection.Binder
+binder, System.Globalization.CultureInfo culture)
+in <0x0001a> System.Reflection.FieldInfo:SetValue (System.Object obj,
+System.Object value)
+in <0x00162> Microsoft.VisualBasic.CompilerServices.LateBinding:LateSet
+(System.Object o, System.Type objType, System.String name, System.Object[]
+args, System.String[] paramnames)
+in <0x00080> root:main ()
+Expected Results:
+Should assign the value to the field without error.
+How often does this happen? 
+Always with mono vb-runtime.
+Never with microsoft runtime.
+Additional Information:
+Happens with both mono and microsoft compiled binaries.
+The same stack-trace is shown so the generated code should be correct,
+problem is probably in the mono vb-runtime library.

More information about the mono-bugs mailing list