I have SubclassOf derived from PosetRelation. For any poset relation, the transitivity law applies, however, I'd like to return the correct type:

```
   PosetRelation transitivity(PosetRelation R, PosetRelation S)
   {
      if (R.op == S.op)
      {
         if (R.right is S.left)
            return new SubclassOf(R.left, S.right);
      }

      return null;
   }

```

How does one accomplish this in D? Because PosetRelation doesn't know about SubclassOf, in general.

Reply via email to