title: The given expression is never of the provided type
body: <p>I have an abstract class, let's call it <code>Base</code>. I then have a number of classes inheriting from <code>Base</code>, like this example:</p>
  <pre><code>public class Actual : Base
  {
      ...
  }
  </code></pre>
  <p>I want to determine if the actual type (not the abstract base) at runtime is a specific type (using the <a href="https://docs.microsoft.com/es-es/dotnet/csharp/language-reference/keywords/is" rel="nofollow noreferrer">is keyword</a>). It is done in a method which accepts any class, which inherits from <code>Base</code>:</p>
  <pre><code>public void Method(Base input)
  {
      if (input.GetType() is Actual)
      {
          // do something
      }
  }
  </code></pre>
  <p>This gives me a warning in Visual Studio (2019) stating that:</p>
  <blockquote>
  <p>CS0184: The given expession is never of the provided ('Actual') type</p>
  </blockquote>
  <p>Why is this? The <code>Actual</code> class is only one of many, which inherits from <code>Base</code>. So it is in no way given, that it will be of that type at runtime...</p>
  <p><strong>Note:</strong></p>
  <p>I have tried to follow <code>Actual</code> by using <code>Ctrl</code> + <code>Click</code> and I have done the same for <code>Base</code>. In both cases I end up at the expected classes. Also, there are no duplicate class names in any of the assemblies which is involved in the solution.</p>