Open
Description
Description
According to the docs:
Exceptions
ArgumentException
...
The current instance or interfaceType argument is an open generic type; that is, the ContainsGenericParameters property returns true.
The current instance
I guess it refers to the type on which the method is called, which in my examples below is always an open type, and it does not throw for that.
While the interfaceType argument
only throws if I manually write it as an open generic, while if I retrieve it through reflection it does not.
Reproduction Steps
See fiddle: https://dotnetfiddle.net/8698i5
Expected behavior
According to the docs it should always throw
Actual behavior
It throws only if both types are specified as open generics through typeof()
and not via reflection
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response