Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 219f7a5

Browse files
committed
fix pcl build error
1 parent ccf34dc commit 219f7a5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/ServiceStack.Text/ReflectionExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,13 +1796,17 @@ public static Type GetCollectionType(this Type type)
17961796

17971797
static Dictionary<string, Type> GenericTypeCache = new Dictionary<string, Type>();
17981798

1799-
public static Type GetCachedGenericType(this Type type, Type[] argTypes)
1799+
public static Type GetCachedGenericType(this Type type, params Type[] argTypes)
18001800
{
1801-
if (!type.IsGenericTypeDefinition)
1801+
if (!type.IsGenericTypeDefinition())
18021802
throw new ArgumentException(type.FullName + " is not a Generic Type Definition");
18031803

1804+
if (argTypes == null)
1805+
argTypes = Type.EmptyTypes;
1806+
18041807
var sb = StringBuilderThreadStatic.Allocate()
18051808
.Append(type.FullName);
1809+
18061810
foreach (var argType in argTypes)
18071811
{
18081812
sb.Append('|')

src/ServiceStack.Text/TypeConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class TypeConstants
1313
public static readonly bool[] EmptyBoolArray = new bool[0];
1414
public static readonly byte[] EmptyByteArray = new byte[0];
1515
public static readonly object[] EmptyObjectArray = new object[0];
16-
public static readonly Type[] EmptyTypeArray = new Type[0];
16+
public static readonly Type[] EmptyTypeArray = Type.EmptyTypes;
1717
public static readonly FieldInfo[] EmptyFieldInfoArray = new FieldInfo[0];
1818
public static readonly PropertyInfo[] EmptyPropertyInfoArray = new PropertyInfo[0];
1919

0 commit comments

Comments
 (0)