Disambiguating module of template call with shared symbol prevents building
### Description

`c.nim`:
```nim
type K* = object
```

`s.nim`:
```nim
import ./c
export c
template K*(kind: static int): auto = typedesc[c.K]
template B*(kind: static int): auto = typedesc[c.K]
```

`p.nim`:
```nim
import ./s
discard default(K(0))       # works
discard default(s.B(0))     # works
discard default(s.K(0))     # doesn't work
```

### Nim Version

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

git hash: 92e505577e8b6b9214b6fcdd7fe1b0e9a244023b
active boot switches: -d:release
```

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

git hash: 469a6044c00ce657d2f543f292678b3c71e0b037
active boot switches: -d:release
```

### Current Output

```text
p.nim(4, 20) Error: type mismatch: got 'int literal(0)' for '0' but expected 'K = object'
```


### Expected Output

```text
That default(s.K(0)) builds if default(K(0)) and discard default(s.B(0)) build
```


### Possible Solution

_No response_

### Additional Information

_No response_