Calling GetType
on a Type
variable will always return the System.Type
representation, which is equivalent to
typeof(System.Type)
. This also applies to passing a Type
argument to IsInstanceOfType
which always returns
false
.
In both cases, the results are entirely predictable and should be avoided.
Exceptions
Calling GetType
on System.Type
is considered compliant to get an instance of System.RuntimeType
, as
demonstrated in the following example:
typeof(Type).GetType(); // Can be used by convention to get an instance of 'System.RuntimeType'