Compile-time `SIGSEGV` with `template y(): V[false] = V[false](l: 0)`
### Description

```nim
type
  V[d: static bool] = object
    l: int

template y(): V[false] = V[false](l: 0)
discard y()
```

### Nim Version

```
Nim Compiler Version 2.0.14 [Linux: amd64]
Compiled at 2025-01-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: bf4de6a394e040d9810cba8c69fb2829ff04dcc6
active boot switches: -d:release
```

```
Nim Compiler Version 2.2.1 [Linux: amd64]
Compiled at 2025-01-21
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 12347eae74dbaa0e4dd99691e3a4509e8fe8b265
active boot switches: -d:release
```

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

git hash: 793baf34ff72cb8c5485ce209af086e27f656853
active boot switches: -d:release
```

### Current Output

```text
........................................................................SIGSEGV: Illegal storage access. (Attempt to read from nil?)
```

### Expected Output

```text
No SIGSEGV on compilation
```

### Known Workarounds

_No response_

### Additional Information

_No response_