]> O.S.I.I.S - jp/crow.git/commitdiff
dont try to find covertion methode to object in emitted MSIL
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 18 Oct 2016 16:03:07 +0000 (18:03 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Tue, 18 Oct 2016 16:03:07 +0000 (18:03 +0200)
src/CompilerServices/CompilerServices.cs

index 96f129638a73f78bf0a3679606211f5be236bf72..305c9a5f4f8c9c3dd31f8e41b9c6b1d520f3ed9a 100644 (file)
@@ -362,7 +362,7 @@ namespace Crow
                                                il.Emit (OpCodes.Callvirt, tostring.Method);
                                        } else if (!sourceValueType.IsValueType)
                                                il.Emit (OpCodes.Castclass, sourceValueType);
-                                       else if (b.Source.Property.PropertyType != sourceValueType) {
+                                       else if (b.Source.Property.PropertyType != sourceValueType && b.Source.Property.PropertyType != typeof(object)) {
                                                il.Emit (OpCodes.Callvirt, CompilerServices.GetConvertMethod (b.Source.Property.PropertyType));
                                        } else
                                                il.Emit (OpCodes.Unbox_Any, b.Source.Property.PropertyType);