type safe type comparison

This commit is contained in:
Paul Pacheco 2020-09-21 23:00:30 -05:00
parent 541b516d60
commit 85d26ebce6

View File

@ -108,12 +108,12 @@ public static bool IsArrayType(this TypeReference tr)
public static bool IsArraySegment(this TypeReference td)
{
return td.FullName.StartsWith("System.ArraySegment`1", System.StringComparison.Ordinal);
return td.Resolve().Is(typeof(ArraySegment<>));
}
public static bool IsList(this TypeReference td)
{
return td.FullName.StartsWith("System.Collections.Generic.List`1", System.StringComparison.Ordinal);
return td.Resolve().Is(typeof(List<>));
}
public static bool CanBeResolved(this TypeReference parent)