with `{.push deprecated.}`, get `unhandled exception: ast.nim(1073, 3) `result == nil or result.kind == nkPragma`  [AssertionDefect]`
### Description

```nim
{.push deprecated.}
template j(s: untyped) = s
proc m(): int = discard
j do:
  discard m()
```

### Nim Version

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

git hash: 5935c3bfa9fec6505394867b23510eb5cbab3dbf
active boot switches: -d:release
```

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

git hash: 9d65507d202afcfdf9421fc1e2c9cba3325059ba
active boot switches: -d:release
```

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

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

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

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

### Current Output

```text
Error: unhandled exception: ast.nim(1073, 3) `result == nil or result.kind == nkPragma`  [AssertionDefect]
```


### Expected Output

```text
No internal compiler assertion
```


### Known Workarounds

_No response_

### Additional Information

_No response_