The simple answer is, do the following:
if (x :> obj) :? Test then printfn "true" else printfn "false"
This problem arises due to the implementation of DU (using internal classes and tags) and the restriction of a system like F # (which does not confirm the implementation).
As you saw, type x is equal to FSI_0001+Test+Age , and F # does not recognize this as a subtype of Test .
source share