Recursive dependencies of gdobj
I'm trying to get a state machine module of mine ported from GDScript to Nim.

In GDScript, I had a `state.gd` and `state_machine.gd`, both extensions of `Node`. Each `State` instance has a member pointing to its `StateMachine` parent, and each `StateMachine` keeps a reference of its child `State`s.

Translating this to Nim, I started with `import` `state` and `state_machine` into each other. However, naturally I run into a recursive type dependency this way. Normally, as I understand Nim (only a couple week's experience), the [go-to way](https://nim-lang.org/docs/tut2.html#object-oriented-programming-mutually-recursive-types) to solve this is to define both in a single type declaration, a la

```
type
  State = ref object
    ... 
  StateMachine = object
    ...
```

But I can't figure out how to get this to play with types defined with the `gdobj` macro.

The farthest I've gotten to solving this so far is a single `states.nim` file, like so:

```
import
  godot, node

type
  State = object of Node

gdobj StateMachine of Node:
  ...

gdobj State of Node:
  ... 
```

I run into a new issue here:

```
gdobj StateMachine of Node:
  ...
  method ready*() =
    self.HOST = get_parent() as Node

    for state in get_children():
      # I tried `state of State` here, but was getting "Error: 'Variant:ObjectType' can never be of this subtype"
      if state is State:
        let as_state: State = state as State
```

```
states.nim(36, 37) Error: type mismatch: got <Variant, type State>
but expected one of: 
proc `as`[T: NimGodotObject](obj: NimGodotObject; t: typedesc[T]): T
  first type mismatch at position: 1
  required type: NimGodotObject
  but expression 'state' is of type: Variant
proc `as`[T: NimGodotObject](obj: NimGodotObject; t: typedesc[T]): T
  first type mismatch at position: 2
  required type: type T: NimGodotObject
  but expression 'State' is of type: type State

expression: state as State
```

It seems that the `State` type isn't being understood as a `NimGodotObject` (even if it is `of Node`?), nor is `state` understood as a `NimGodotObject` (even if it is of `Variant`). 

I suspect this all comes back to my `type` statement, which is effectively a bandaid solution to the original recursive import problem. So, with this in mind, how should I be handling recursive imports with `gdobj`-defined types, or how can I better define my types with this solution?

Also, as an aside, am I doing iteration and casting over a `Node`'s children incorrectly?