[AssertionDefect] semtypes.nim(1824, 13) `r[0].kind == nkSym`
### Description

```nim
import std/[asyncdispatch, httpclient, strutils, json, times]

type
  Tree[T] = object
    x: T
    rr: seq[Tree[T]]
  I = Tree[int]
  F = Tree[Future[string]]

proc title(t: I): Future[string] {.async,gcsafe.} =
  let cli = newAsyncHttpClient()
  let c = await cli.getContent("https://jsonplaceholder.typicode.com/todos/" & $t.x)
  c.parseJson()["title"].getStr()

proc map[T,U](t: T, f: proc (x: T): U{.async.gcsafe.}): U =
  result.x = f(t)
  for r in t.rr:
    result.rr.add map(r, f)

proc f(t: F, l: int) {.async.} =
  echo repeat(' ', l), (await t.x)
  for r in t.rr:
    await f(r, l+1)

proc asyncMain() {.async.} =
  let t = I(x: 1, rr: @[I(x: 2), I(x: 3, rr: @[I(x: 4), I(x: 5)])])
  await f(map[I,F](t, title), 0)

let a = now()
waitFor asyncMain()
echo now() - a
```


### Nim Version

```
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 78983f1876726a49c69d65629ab433ea1310ece1
active boot switches: -d:release
```

### Current Output

```text
> nim r pcomm.nim
Hint: used config file '/home/u/.choosenim/toolchains/nim-2.2.0/config/nim.cfg' [Conf]
Hint: used config file '/home/u/.choosenim/toolchains/nim-2.2.0/config/config.nims' [Conf]
........................................................................................................................................................assertions.nim(34)       raiseAssert
Error: unhandled exception: semtypes.nim(1824, 13) `r[0].kind == nkSym`  [AssertionDefect]
```


### Expected Output

_No response_

### Known Workarounds

It was caused by async,gcsafe pragmas in title proc. Not sure that the program is correct, but it should not fail during compilation in any case

### Additional Information

_No response_