This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
tests/NetCore.Console.Tests Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ public static Type[] GetTypeGenericArguments(this Type type)
117
117
public static ConstructorInfo GetEmptyConstructor ( this Type type )
118
118
{
119
119
#if ( NETFX_CORE || PCL || NETSTANDARD1_1 )
120
- return type . GetTypeInfo ( ) . DeclaredConstructors . FirstOrDefault ( c => c . GetParameters ( ) . Count ( ) == 0 ) ;
120
+ return type . GetTypeInfo ( ) . DeclaredConstructors . FirstOrDefault ( c => c . GetParameters ( ) . Length == 0 ) ;
121
121
#else
122
122
return type . GetConstructor ( Type . EmptyTypes ) ;
123
123
#endif
Original file line number Diff line number Diff line change @@ -78,7 +78,10 @@ public static class ReflectionExtensions
78
78
79
79
public static Type [ ] GetGenericArguments ( this Type type )
80
80
{
81
- return type . GetTypeInfo ( ) . GenericTypeArguments ;
81
+ //http://stackoverflow.com/a/39140220/85785
82
+ return type . GetTypeInfo ( ) . IsGenericTypeDefinition
83
+ ? type . GetTypeInfo ( ) . GenericTypeParameters
84
+ : type . GetTypeInfo ( ) . GenericTypeArguments ;
82
85
}
83
86
84
87
internal static TypeInfo GetTypeInfo ( this Type type )
Original file line number Diff line number Diff line change 14
14
"frameworks" : {
15
15
"netcoreapp1.1" : {
16
16
"dependencies" : {
17
- "Microsoft.NETCore.App" : {
18
- "type" : " platform" ,
19
- "version" : " 1.0.1"
20
- }
21
17
},
22
18
"imports" : [
23
19
" dotnet5.6" ,
You can’t perform that action at this time.
0 commit comments