- Home /
Question by
Sylario · May 03, 2011 at 01:39 PM ·
inheritance
C# question about inheritance
class C inherit from class B that inherit from class gameObject.
I have an array of gameObject. When i test :
if (gameObj is B)
Visual C# underline it saying the given expression is never of the given type (B).
At runtime i know one of the object has been created as a C, but it never match my if condition. Why?
How can Visual C# know that it will not work?
Comment