I ran across this code during some debugging.
private bool HasBaseType(Type type, out Type baseType)
{
Type originalType = type.GetType();
baseType = Get
It looks like neither. When you call GetType
on a Type
instance, it seems to always return RuntimeType
.
I checked this against the System assembly by running this code snippet:
Assembly
.GetAssembly(typeof(int))
.GetTypes()
.Where(type => type.GetType() == type)
Edit: As Luke clarified in comments, the "original type" is only actually the original type when given a RuntimeType
- it doesn't work for anything else. And since that type is internal to system, the method seems simply wrong.