With `const c: cstring` using literal `string` value from `template`, `Error: type mismatch: got 'cstring' for '""' but expected 'string'`
### Description

```nim
# Either changing the template to `proc`/`func` or using `$""`, not a string
# literal alone, allows any version of Nim 2.x to compile this.
template g(): string = ""

# Alternatively: don't retrieve the string through g(), but directly, also
# allows compilation across Nim 2.x versions.
const d: cstring = ""
const f: cstring = $""
const b = cstring g()
const m = cstring ""
const p = cstring $""

# But this does not compile across Nim 2.x/devel.
const c: cstring = g()
```

### Nim Version

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

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

```
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-13
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 78983f1876726a49c69d65629ab433ea1310ece1
active boot switches: -d:release
```

```
Nim Compiler Version 2.2.1 [Linux: amd64]
Compiled at 2024-10-13
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 720d0aee5c2d56260587f9ab09220d18ab9b53f7
active boot switches: -d:release
```

### Current Output

```text
/tmp/u.nim(14, 21) Error: type mismatch: got 'cstring' for '""' but expected 'string'
```


### Expected Output

```text
Builds, or otherwise consistent behavior. Using many minor variations allows the compile-time context to trigger properly, just this one specific way of accessing it triggers this error.
```


### Known Workarounds

_No response_

### Additional Information

Related to https://github.com/nim-lang/Nim/issues/24295 but the method syntax usage seems to have accidentally worked around this through 2.0, until 2.2 (even giving the template a dummy parameter works in 2.0):
```nim
template g(x: int): string = ""
const c: cstring = 0.g()
```
works in 2.0 but not 2.2/devel; see linked issue for more.

This issue points to a broader case which also did not work in 2.0.x.