Very basic code fails from generic alias replacing concrete typedesc argument
### Description

This test code is so simple I would think there has to be an issue for it but I couldn't find one. Even if there is I feel like this would have to be fixed with higher priority.

```nim
type Foo[T] = int

proc foo(T: typedesc) =
  var a: T

foo(int)
```

Even happens if `Foo` is defined in another module.


### Nim Version

2e4d344b43b040a4dce2c478ca13e49979e491fc and 2.0.8 going back at least to 1.0

### Current Output

```text
(6, 4) template/generic instantiation of `foo` from here
(4, 7) Error: invalid type: 'Foo' for var
```


### Expected Output

```text
compiles
```


### Possible Solution

_No response_

### Additional Information

_No response_