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)
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 ( '|' )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments