Regression from `version-2-0` to `devel` with generic object param type with default value: `Maybe generic arguments are missing?`
### Description

```nim
type M[V] = object
template y[V](N: type M, v: V): M[V] = default(M[V])
proc d(x: int | int, f: M[int] = M.y(0)) = discard
d(0, M.y(0))
```

### Nim Version

Builds:
```
Nim Compiler Version 2.0.9 [Linux: amd64]
Compiled at 2024-09-10
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 8d254a5945c5cb7612dff2a53be8f8d12b846d60
active boot switches: -d:release
```

Does not build:
```
Nim Compiler Version 2.1.99 [Linux: amd64]
Compiled at 2024-09-10
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 21771765a2c1f1fc86d87ad6e032d4050d8a651b
active boot switches: -d:release
```

### Current Output

```text
/tmp/h.nim(4, 2) Error: cannot instantiate: 'M[V]'; Maybe generic arguments are missing?
```


### Expected Output

```text
Builds
```


### Known Workarounds

_No response_

### Additional Information

_No response_