You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dictionary<string, object?> is the concrete type. IDictionary<string, object?> is the closed generic type. IDictionary<,> is the open generic type (generic type definition).
Checking if the concrete type implements either the closed or open generic types returns True as expected.
But checking if the closed generic type implements its open generic type returns False, which is not correct in my opinion. I would have expected it to return True since the closed generic type is essentially an "implementation" of its generic type definition.
Can anyone comment on this?
Thanks
The text was updated successfully, but these errors were encountered:
I am using IsConstructedGenericType and GetGenericTypeDefinition() to check the open generic type, while also keeping Implements() for all other cases.
Hello,
please have a look at this fiddle: https://dotnetfiddle.net/NlY70e
Dictionary<string, object?>
is the concrete type.IDictionary<string, object?>
is the closed generic type.IDictionary<,>
is the open generic type (generic type definition).Checking if the concrete type implements either the closed or open generic types returns
True
as expected.But checking if the closed generic type implements its open generic type returns
False
, which is not correct in my opinion. I would have expected it to returnTrue
since the closed generic type is essentially an "implementation" of its generic type definition.Can anyone comment on this?
Thanks
The text was updated successfully, but these errors were encountered: