Skip to content

Commit

Permalink
Add ReferenceConverter entry to intrinsic type converters table (dotn…
Browse files Browse the repository at this point in the history
…et#39854)

* Add ReferenceConverter entry to intrinsic type converters table

* Add tests
  • Loading branch information
safern authored and Jacksondr5 committed Aug 10, 2020
1 parent 1438585 commit a42d338
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ internal ReflectTypeDescriptionProvider()
[typeof(ICollection)] = typeof(CollectionConverter),
[typeof(Enum)] = typeof(EnumConverter),
[s_intrinsicNullableKey] = typeof(NullableConverter),
[s_intrinsicReferenceKey] = typeof(ReferenceConverter),
});

private static Hashtable PropertyCache => LazyInitializer.EnsureInitialized(ref s_propertyCache, () => new Hashtable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ public void GetAssociationReturnsDesigner()
[InlineData(typeof(CultureInfo), typeof(CultureInfoConverter))]
[InlineData(typeof(Version), typeof(VersionConverter))]
[InlineData(typeof(IComponent), typeof(ComponentConverter))]
[InlineData(typeof(IFooComponent), typeof(ReferenceConverter))]
public static void GetConverter(Type targetType, Type resultConverterType)
{
TypeConverter converter = TypeDescriptor.GetConverter(targetType);
Expand Down Expand Up @@ -1151,5 +1152,10 @@ class FooBarDerived : FooBarBase
[Description("Derived")]
public override int Value { get; set; }
}

interface IFooComponent
{
bool Flag { get; set; }
}
}
}

0 comments on commit a42d338

Please sign in to comment.