This doesn't match the docs: https://docs.microsoft.com/en-us/dotnet/api/system.xaml.xamlschemacontext.getxamltype?view=netframework-4.7.2#System_Xaml_XamlSchemaContext_GetXamlType_System_Type_
Example test:
[Fact]
public void GetXamlType_NullXamlType_ThrowsNullReferenceException()
{
var context = new XamlSchemaContext();
Assert.Throws<NullReferenceException>(() => context.GetXamlType((Type)null));
}
Problematic code:
public virtual XamlType GetXamlType(Type type)
{
return GetXamlType(type, XamlLanguage.TypeAlias(type)); // <-- NRE thrown in TypeAlias
}
internal XamlType GetXamlType(Type type, string alias)
{
if (type == null)
{
throw new ArgumentNullException(nameof(type));
}
XamlType xamlType = null;
if (!MasterTypeList.TryGetValue(type, out xamlType))
{
xamlType = new XamlType(alias, type, this, null, null);
xamlType = TryAdd(MasterTypeList, type, xamlType);
}
return xamlType;
}
Should the code be updated, or the docs? I can fix the code if requested!
This doesn't match the docs: https://docs.microsoft.com/en-us/dotnet/api/system.xaml.xamlschemacontext.getxamltype?view=netframework-4.7.2#System_Xaml_XamlSchemaContext_GetXamlType_System_Type_
Example test:
Problematic code:
Should the code be updated, or the docs? I can fix the code if requested!