title: How to Properly match F# Class Type
body: <p>I'm working with C# object types, but I think the snippet below illustrates my problem.  I can't find anything related to the specific compiler warning, "This type test or downcast will always hold" (when matching against C# types I get "This rule will never be matched").<br>
  <a href="https://stackoverflow.com/questions/26937533/f-how-to-have-a-values-type-determined-by-a-match-statement">This post</a> is similar, but seems specific to pattern matching (same results as below when using if/then/else).</p>
  
  <pre class="lang-ml prettyprint-override"><code>type Parent =
    val a : int
    new(a0) = { a = a0; }
  
  type Child(a) =
    inherit Parent(a)
  
  let MatchFunc (obj:Parent) =
    match obj with
    | :? Parent -&gt; "Parent"
    | :? Child -&gt; "Child"
    | _ -&gt; "Neither"
  
  let c = new Child(1)
  MatchFunc c
  </code></pre>