* [XamlC] treat netstandard types as mscorlib (#1281)

If the end user project type differs from Core's type, the compiler can
be confused while comparing base styles, like System.Double.

this fixes that by assuming System.Runtime, mscorlib and netstnadard
types are equivalent (because they are)

* [C] fix an issue with netstandard when context type is object (#1282)

* [XamlC] fix typo

fixes #1316, fixes #1368
This commit is contained in:
Stephane Delcroix 2017-12-14 08:58:12 +01:00 коммит произвёл GitHub
Родитель 1328eca7be
Коммит d7e1569b13
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 10 добавлений и 9 удалений

Просмотреть файл

@ -24,11 +24,16 @@ namespace Xamarin.Forms.Build.Tasks
if (x.FullName != y.FullName)
return false;
var xasm = GetAssembly(x);
if (xasm.StartsWith("System.Runtime", StringComparison.Ordinal) || xasm.StartsWith("mscorlib", StringComparison.Ordinal))
xasm = "mscorlib";
var yasm = GetAssembly(y);
if (yasm.StartsWith("System.Runtime", StringComparison.Ordinal) || yasm.StartsWith("mscorlib", StringComparison.Ordinal))
yasm = "mscorlib";
//standard types comes from either mscorlib. System.Runtime or netstandard. Assume they are equivalent
if ( (xasm.StartsWith("System.Runtime", StringComparison.Ordinal)
|| xasm.StartsWith("mscorlib", StringComparison.Ordinal)
|| xasm.StartsWith("netstandard", StringComparison.Ordinal))
&& (yasm.StartsWith("System.Runtime", StringComparison.Ordinal)
|| yasm.StartsWith("mscorlib", StringComparison.Ordinal)
|| yasm.StartsWith("netstandard", StringComparison.Ordinal)))
return true;
return xasm == yasm;
}

Просмотреть файл

@ -316,11 +316,7 @@ namespace Xamarin.Forms
}
}
else
{
property = sourceType.GetDeclaredProperty(part.Content);
if (property == null)
property = sourceType.BaseType.GetProperty(part.Content);
}
property = sourceType.GetDeclaredProperty(part.Content) ?? sourceType.BaseType?.GetProperty(part.Content);
if (property != null)
{