Inheritance of type in generics passes type constraint but fails in execution
### Description

I'm using the playground to try to test out the creation of a simple entity-component relational model in Nim, using generics.

The following code example shows the situation and the test scenario of assigning a single component to an entity.

```nim
import std/tables
import std/sequtils

type
  Component* = object of RootObj
  Subtree[T] = OrderedTableRef[ typedesc[T], seq[T] ]

let universe = newOrderedTable[ string, Subtree[ Component ]]()

proc drop*[T: Component]( uuid: string, components: seq[T] ) =
  universe.withValue( uuid, branch ):
    branch.withValue( T, leaf ):
      for component in components:
        leaf.del( component )

proc put*[T: Component]( uuid: string, components: seq[T] ) =
  let branch = universe.mgetOrPut( uuid, Subtree[T]() ) # <-- fails here!
  if not branch.hasKey( T ):
    branch[T] = components
  else:
    branch.withValue( T, leaf ):
      for component in components:
        if component notin leaf:
          leaf.add( component )

# TESTS FOLLOW

type 
  Dummy = object of Component
    value: int

echo "Creating dummy component ..."
let d0 = Dummy( value: 0 )
echo $d0

echo "Performing insert on 'zero' ..."
put("zero", @[ d0 ])
echo "Done."
```

### Nim Version

Using "latest" (via [NimPlayground](https://play.nim-lang.org/))

### Current Output

```text
/usercode/in.nim(46, 4) template/generic instantiation of `put` from here
/usercode/in.nim(17, 24) Error: type mismatch
Expression: mgetOrPut(universe, uuid, Subtree[T]())
  [1] universe: OrderedTableRef[system.string, Subtree[in.Component]]
  [2] uuid: string
  [3] Subtree[T](): Subtree[in.Dummy]

Expected one of (first mismatch at [position]):
[1] proc mgetOrPut[A, B](t: TableRef[A, B]; key: A; val: B): var B
[1] proc mgetOrPut[A, B](t: var OrderedTable[A, B]; key: A; val: B): var B
[1] proc mgetOrPut[A, B](t: var Table[A, B]; key: A; val: B): var B
[3] proc mgetOrPut[A, B](t: OrderedTableRef[A, B]; key: A; val: B): var B
```


### Expected Output

```text
Creating dummy component ...
<some instance of Dummy>
Performing insert on 'zero' ...
Done.
```


### Possible Solution

_No response_

### Additional Information

As best I can tell from the debugger's output, it's correctly recognizing that I wish to create a `Subtree` of `Dummy` (position 3), but fails to assert that Dummy is an object of Component, despite passing the constraint of `[T: Component]` to reach line 17.

Since the currently available documentation on the nim-lang.org site does not provide guidance on inheritance in generics (or how to explicitly declare this via a type constraint), I would assume that this *should* resolve normally.

Searching the bug list, this might be related to #88.