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
Environment:
I have a custom type - "MyType", the heir from the type "Type".
The "UnderlyingSystemType" property of my class is overridden and returns "null".
There is a variable of type "MyType", let's call it "myType_Variable".
And there is a variable of any type, let's call it "anyType_Variable"
A task:
Perform the method - Type.IsAssignableFrom(Type c)
I get:
NullReferenceException: Object reference not set to an instance of an object
How do I think the problem is in the falsely flashing method IsAssignableFrom(Type c) from the .NET Framework.
Code from .NET Frameworks:
... RuntimeType underlyingSystemType = this.UnderlyingSystemType as RuntimeType; if (underlyingSystemType != null) { return underlyingSystemType.IsAssignableFrom(c); }
...
I understand that I can override method IsAssignableFrom(Type c), I did so, but it seems to me that this use case should be out of the box. method IsAssignableFrom(Type c) is not mandatory for implementation.
The text was updated successfully, but these errors were encountered:
Kind time of day.
Sorry for my English.
Environment:
I have a custom type - "MyType", the heir from the type "Type".
The "UnderlyingSystemType" property of my class is overridden and returns "null".
There is a variable of type "MyType", let's call it "myType_Variable".
And there is a variable of any type, let's call it "anyType_Variable"
A task:
Perform the method - Type.IsAssignableFrom(Type c)
I get:
NullReferenceException: Object reference not set to an instance of an object
Analysis:
I found out that the problem is in the IsRuntimeImplemented() method and the implementation of the IsAssignableFrom(Type c) method.
How do I think the problem is in the falsely flashing method IsAssignableFrom(Type c) from the .NET Framework.
Code from .NET Frameworks:
...
RuntimeType underlyingSystemType = this.UnderlyingSystemType as RuntimeType;
if (underlyingSystemType != null)
{
return underlyingSystemType.IsAssignableFrom(c);
}
...
I understand that I can override method IsAssignableFrom(Type c), I did so, but it seems to me that this use case should be out of the box. method IsAssignableFrom(Type c) is not mandatory for implementation.
The text was updated successfully, but these errors were encountered: