This question must've been asked before, I'm pretty sure I'm missing something obvious, but I'm struggling to find an answer to this.
Say we have an abstract class called Base
, and we have a class that inherits from it, called Derived
.
Considering that, I don't understand why the following condition in the if
clause doesn't evaluate to true
?!
ISomeInterface<Derived> foo = ...;
if (foo is ISomeInterface<Base>) // => false - but why?!
{
// Blah blah...
}
While this would:
Derived foo = ...;
if (foo is Base) // true
{
// Blah blah...
}
I'd appreciate it if you point me in the right direction.