From: jpbruyere Date: Tue, 18 Oct 2016 16:03:07 +0000 (+0200) Subject: dont try to find covertion methode to object in emitted MSIL X-Git-Tag: v0.5.1~28^2~25 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=d49bc44d3a21b277c002fa0812133e67b4e3d839;p=jp%2Fcrow.git dont try to find covertion methode to object in emitted MSIL --- diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs index 96f12963..305c9a5f 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/src/CompilerServices/CompilerServices.cs @@ -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);