This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1796,13 +1796,17 @@ public static Type GetCollectionType(this Type type)
1796
1796
1797
1797
static Dictionary < string , Type > GenericTypeCache = new Dictionary < string , Type > ( ) ;
1798
1798
1799
- public static Type GetCachedGenericType ( this Type type , Type [ ] argTypes )
1799
+ public static Type GetCachedGenericType ( this Type type , params Type [ ] argTypes )
1800
1800
{
1801
- if ( ! type . IsGenericTypeDefinition )
1801
+ if ( ! type . IsGenericTypeDefinition ( ) )
1802
1802
throw new ArgumentException ( type . FullName + " is not a Generic Type Definition" ) ;
1803
1803
1804
+ if ( argTypes == null )
1805
+ argTypes = Type . EmptyTypes ;
1806
+
1804
1807
var sb = StringBuilderThreadStatic . Allocate ( )
1805
1808
. Append ( type . FullName ) ;
1809
+
1806
1810
foreach ( var argType in argTypes )
1807
1811
{
1808
1812
sb . Append ( '|' )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static class TypeConstants
13
13
public static readonly bool [ ] EmptyBoolArray = new bool [ 0 ] ;
14
14
public static readonly byte [ ] EmptyByteArray = new byte [ 0 ] ;
15
15
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 ;
17
17
public static readonly FieldInfo [ ] EmptyFieldInfoArray = new FieldInfo [ 0 ] ;
18
18
public static readonly PropertyInfo [ ] EmptyPropertyInfoArray = new PropertyInfo [ 0 ] ;
19
19
You can’t perform that action at this time.
0 commit comments