Regression from 2.0 to 2.2/devel with static generics
### Description

```nim
type H[c: static[float64]] = object
  value: typeof(c)

proc u[T: H](_: typedesc[T]) =
  discard default(T)

u(H[1'f64])
```

### Nim Version

Compiles:
```
Nim Compiler Version 2.0.15 [Linux: amd64]
Compiled at 2025-02-24
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 41637db18f6a82df4a92f2e00a780e5815d17028
active boot switches: -d:release
```

Doesn't compile:
```
Nim Compiler Version 2.2.2 [Linux: amd64]
Compiled at 2025-02-24
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 6c34f62785263ad412f662f3e4e4bf8d8751d113
active boot switches: -d:release
```

```
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-02-24
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 1f8da3835f6e395d068c92f86787f0fa77fb6d08
active boot switches: -d:release
```

### Current Output

```text
/tmp/k.nim(7, 2) template/generic instantiation of `u` from here
/tmp/k.nim(5, 18) template/generic instantiation of `default` from here
/tmp/nimdevel/lib/system.nim(918, 17) Error: invalid type: 'static[float64](1.0'f64)' in this context: 'proc (_: typedesc[H[1.0'f64]]): H[1.0'f64]{.noSideEffect, gcsafe.}' for proc
```

### Expected Output

```text

```

### Known Workarounds

_No response_

### Additional Information

_No response_