summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-02-02 14:19:03 (GMT)
committerGitHub <noreply@github.com>2017-02-02 14:19:03 (GMT)
commiteacbc1acf4cc2b95b98099d069e7bfa31c89f4f8 (patch)
tree5b4b6eb618cba84ec9dbec4a86dd5cdb8ffd3f04 /Xamarin.Forms.Xaml
parentc25a360efbbbe1f161e6737e61aed4b96cd37ac3 (diff)
downloadxamarin-forms-eacbc1acf4cc2b95b98099d069e7bfa31c89f4f8.zip
xamarin-forms-eacbc1acf4cc2b95b98099d069e7bfa31c89f4f8.tar.gz
xamarin-forms-eacbc1acf4cc2b95b98099d069e7bfa31c89f4f8.tar.bz2
[Xaml[C]] check for compatible types on op_implicit (#715)
* [Xaml[C]] check for compatible types on op_implicit * fix merge issue
Diffstat (limited to 'Xamarin.Forms.Xaml')
-rw-r--r--Xamarin.Forms.Xaml/TypeConversionExtensions.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Xamarin.Forms.Xaml/TypeConversionExtensions.cs b/Xamarin.Forms.Xaml/TypeConversionExtensions.cs
index 15a66f5..da8e711 100644
--- a/Xamarin.Forms.Xaml/TypeConversionExtensions.cs
+++ b/Xamarin.Forms.Xaml/TypeConversionExtensions.cs
@@ -176,7 +176,7 @@ namespace Xamarin.Forms.Xaml
if (!mi.IsSpecialName) continue;
if (mi.Name != "op_Implicit") continue;
if (!mi.IsPublic) continue;
- if (mi.ReturnType != toType) continue;
+ if (!toType.IsAssignableFrom(mi.ReturnType)) continue;
var parameters = mi.GetParameters();
if (parameters.Length != 1) continue;
if (parameters[0].ParameterType != value.GetType()) continue;
@@ -188,7 +188,7 @@ namespace Xamarin.Forms.Xaml
if (!mi.IsSpecialName) continue;
if (mi.Name != "op_Implicit") continue;
if (!mi.IsPublic) continue;
- if (mi.ReturnType != toType) continue;
+ if (!toType.IsAssignableFrom(mi.ReturnType)) continue;
var parameters = mi.GetParameters();
if (parameters.Length != 1) continue;
if (parameters[0].ParameterType != value.GetType()) continue;